[<<]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 Mon Oct 20 14:19:18 2014 instead of waste ec2-54-82-82-201.compute-1.amazonaws.com/54.82.82.201'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