[<<]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 24 09:31:26 2023 instead of waste ec2-35-175-191-46.compute-1.amazonaws.com/35.175.191.46'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