[<<]Back to the programming manual

Programming Manual: Inline Perl Sample

A typical inline Perl application looks like this:
Any particular reason why you want
<code><perl>$address;</perl></code>?
Don't you have something better to do at
<perl>scalar localtime</perl> instead of waste
<perl>$hostname || (&sock_to_host())[0];</perl>'s time?
which comes out like

Any particular reason why you want /httpi/sperl.shtml? Don't you have something better to do at Sun Sep 8 15:11:12 2024 instead of waste ec2-3-238-227-73.compute-1.amazonaws.com/3.238.227.73's time?

In this example, we've done three things: retrieved a server-internal variable, returned an arbitrary Perl expression ("scalar localtime") and made a HTTPi-internal function call. All of these items returned something, which was displayed.


Cameron Kaiser