<html>
<head>
<title>demo.func</title>
</head>
<body>
<blockquote>
<h1>demo.func</h1>
<p>
<!-- 
##
##  ePerl Demo: definition and usage of a Perl function
##  Copyright (c) 1996,1997 Ralf S. Engelschall, All Rights Reserved. 
##
##  This defines a Perl function in a first ePerl block and
##  later uses the function in another ePerl block.
##
-->

<?
@dow = ( 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' );
@moy = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
         'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' );
sub ctime {
    local($time) = @_[0];

    local($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = 
        localtime($time);
    local($str) = sprintf("%s %s %2d %02d:%02d:%02d 19%s%s",
         $dow[$wday], $moy[$mon], $mday, $hour, $min, $sec, $year, 
         $isdst ?  " DST" : "");
    return $str;
}
!>

Welcome, our local time is <? print &ctime(time()); !>.

</blockquote>
</body>
</html>
