home *** CD-ROM | disk | FTP | other *** search
/ Chip 2000 May / Chip_2000-05_cd1.bin / zkuste / Perl / ActivePerl-5.6.0.613.msi / 䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥 / _d9858841f050c98f9eec6ec9ad9bce44 < prev    next >
Text File  |  2000-03-15  |  2KB  |  74 lines

  1.  
  2. <HTML>
  3.  
  4. <HEAD><TITLE>PerlScript Welcome Sample</TITLE></HEAD>
  5.  
  6. <!-- 
  7.     ActiveState PerlScript sample 
  8.     PerlScript:  The easiest, most powerful way to program custom web solutions. 
  9. -->
  10.  
  11. <BODY BGCOLOR=#FFFFFF>
  12.  
  13. <!-- Table A - Page heading including masthead -->
  14. <TABLE CELLPADDING=0 BORDER=3 CELLSPACING=0>
  15. <TR VALIGN=TOP ><TD>
  16. <A NAME="TOP"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="The power of PerlScript!" BORDER=2></A><P>
  17. </TD></TR></TABLE>
  18.  
  19. <hr>
  20. <BR>
  21. <FONT SIZE=5>
  22.  
  23. <SCRIPT language="PerlScript">
  24.  
  25. sub PrintWelcome {    
  26.     ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime();
  27.     $thisday=(Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday)[$wday];
  28.     $thismon=(January,February,March,April,May,June,July,August,September,October,November,December)[$mon];
  29.     if ($hour < 12) {
  30.         $window->document->write( "Good morning!  ");
  31.     } elsif ($hour < 17) {
  32.         $window->document->write( "Good afternoon!  ");
  33.     } else {
  34.         $window->document->write( "Good evening!  ");
  35.     };
  36.     $ampm = 'AM';
  37.     if ($hour > 12) {
  38.         $hour-=12;
  39.         $ampm = 'PM';
  40.         }
  41.     $time = sprintf '%d:%2.2d:%2.2d',$hour,$min,$sec;
  42.     $year += 1900;
  43.     $datetime = $time.' '.$ampm.', '.$thisday.', '.$thismon.' '.$mday.', '.$year;        
  44.     $window->document->write("Welcome to the world of PerlScript.<BR>  ");
  45.     $window->document->write("Just in case you were wondering, it's<BR> "); 
  46.     $window->document->write($datetime);
  47. }
  48.  
  49. PrintWelcome();
  50.  
  51. </SCRIPT>
  52. </FONT>
  53. <P>
  54. <FONT SIZE=2>
  55. <hr>
  56. If this sample doesn't work, download <A HREF="http://www.microsoft.com/ie/">Internet Explorer 3.0</A> now.
  57. </FONT>
  58.  
  59. <TABLE BORDER=0 CELLPADDING=3 CELLSPACING=0 width=600>
  60. <TR VALIGN=TOP>
  61.     <TD ALIGN=RIGHT>
  62.     <FONT FACE="Arial, Helvetica" SIZE="1">
  63.     <B>Best experienced with<BR> 
  64.     <A HREF="http://www.microsoft.com/ie/" TARGET="_top"><img src="ie_animated.gif" width="88" height="31" border="0" alt="Microsoft Internet Explorer" vspace="5"></a>
  65.     <BR>Click here to start.</B>
  66.     </FONT></TD>
  67. </TR>
  68. </TABLE>
  69.  
  70. </BODY>
  71. </HTML>
  72.  
  73.  
  74.