head 1.1; branch 1.1.1; access ; symbols ePerl_2_2_14:1.1.1.1 RSE:1.1.1; locks ; strict; comment @# @; 1.1 date 99.05.02.14.43.39; author rse; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 99.05.02.14.43.39; author rse; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @
@ 1.1.1.1 log @Import of ePerl 2.2.14 @ text @@demo.func
Perl Programming
sub ctime { my ($time) = @@_; my @@dow = ( 'Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat' ); my @@moy = ( 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ); my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime($time); my ($str) = sprintf("%s %s %2d %02d:%02d:%02d 19%s%s", $dow[$wday], $moy[$mon], $mday, $hour, $min, $sec, $year, $isdst ? " DST" : ""); return $str; } !> This demonstrates the global scoping within a webpage by defining a Perl function in a first ePerl block and later calling this function in another ePerl block.
Local time is =&ctime(time())!>.