📄 example.psp
字号:
#!/usr/local/psp
<%
use Pi3;
sub pspLoad {
$piobj = shift;
$counter = 0;
# This line will go to the console.
print "Counter initialized with $counter.\n";
return 0;
}
sub pspSetResponse {
$counter++;
return 0;
}
%><%@ page parsedLength="true" %>
<html><body background="/icons/Pi3Tile.gif" bgcolor="#FFFFFF">
<table width="100%"><TR>
<td align=LEFT valign=CENTER><h1>Perl Server Pages</h1></td>
<td align=CENTER valign=CENTER><img src="/icons/Pi3Web_earth2.gif" alt="Pi3Web"></td>
</tr></table>
<hr>
<h3>General usage of PSP</h3>
<p><b>My filename is: </b><%= $pspRequest{"Path"}; %>
<p><b>I've been invoked: </b><%= $counter; %> times.
<p><b>The local time is: </b><%= localtime(); %>
<p><b>Your browser is: </b><%= $pspRequest{"User-Agent"}; %>
<h3>Invokation of the Pi3Web API's with the Pi3:: package</h3>
<p><b>Your Pi3 platform is: </b><%= Pi3::PIPlatform_getDescription(); %>
<p><b>Your Pi3Web server is: </b><%= Pi3::HTTPCore_getServerStamp(); %>
<p><b>The Pi3Web handler object is: </b><%= $PiObject = Pi3::PIObject_getName($piobj); %>
<hr><form method="GET" action="/printsource.psp/example.psp">
<input type="Submit" value="PSP Source">
</form>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -