home *** CD-ROM | disk | FTP | other *** search
/ Netrunner 2004 October / NETRUNNER0410.ISO / regular / ActivePerl-5.8.4.810-MSWin32-x86.msi / _2ecea3a812f16672d57590f32a12a3aa < prev    next >
Encoding:
Text File  |  2004-06-01  |  1.5 KB  |  55 lines

  1.  
  2. <HTML>
  3.  
  4. <HEAD><TITLE>PerlScript Welcome Sample</TITLE>
  5. <link rel="stylesheet" type="text/css" href="../HTML/Active.css">
  6. </HEAD>
  7.  
  8. <!-- 
  9.     ActiveState PerlScript sample 
  10.     PerlScript:  The easiest, most powerful way to program custom web solutions. 
  11. -->
  12.  
  13. <BODY>
  14.  
  15. <!-- Table A - Page heading including masthead -->
  16. <TABLE CELLPADDING=0 BORDER=3 CELLSPACING=0>
  17. <TR VALIGN=TOP ><TD>
  18. <A HREF="index.htm" NAME="Image"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="The power of PerlScript!" BORDER=5></A><P>
  19. </TD></TR>
  20. </TABLE>
  21. <hr>
  22. <BR>
  23.  
  24. <SCRIPT language="PerlScript">
  25.  
  26. sub PrintWelcome {    
  27.     ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime();
  28.     $thisday=(Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday)[$wday];
  29.     $thismon=(January,February,March,April,May,June,July,August,September,October,November,December)[$mon];
  30.     if ($hour < 12) {
  31.         $window->document->write( "Good morning!  ");
  32.     } elsif ($hour < 17) {
  33.         $window->document->write( "Good afternoon!  ");
  34.     } else {
  35.         $window->document->write( "Good evening!  ");
  36.     };
  37.     $ampm = 'AM';
  38.     if ($hour > 12) {
  39.         $hour-=12;
  40.         $ampm = 'PM';
  41.         }
  42.     $time = sprintf '%d:%2.2d:%2.2d',$hour,$min,$sec;
  43.     $year += 1900;
  44.     $datetime = $time.' '.$ampm.', '.$thisday.', '.$thismon.' '.$mday.', '.$year;        
  45.     $window->document->write("Welcome to the world of PerlScript.<BR>  ");
  46.     $window->document->write("Just in case you were wondering, it's<BR> "); 
  47.     $window->document->write($datetime);
  48. }
  49.  
  50. PrintWelcome();
  51.  
  52.   </SCRIPT>
  53. <P>
  54. </BODY>
  55. </HTML>