[<<]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 Dec 8 10:01:20 2024 instead of waste 18-97-14-89.crawl.commoncrawl.org/18.97.14.89'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