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

  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  4. <meta name="GENERATOR" content="ActiveState_Hack = Dick Hardt">
  5. <!-- 
  6.     Copyright (c) 1996, Microsoft Corporation.  All rights reserved.
  7.     Developed by ActiveState Internet Corp., http://www.ActiveState.com
  8. -->
  9. <title>VBScript calling PerlScript - Hello, world!</title>
  10. </head>
  11. <BODY BGCOLOR=#FFFFFF>
  12.  
  13. <body>
  14. <!-- 
  15.     ActiveState PerlScript sample 
  16.     PerlScript:  The coolest way to program custom web solutions. 
  17. -->
  18.  
  19. <!-- Masthead -->
  20. <TABLE CELLPADDING=3 BORDER=0 CELLSPACING=0>
  21. <TR VALIGN=TOP ><TD WIDTH=400>
  22. <A NAME="TOP"><IMG SRC="PSBWlogo.gif" WIDTH=400 HEIGHT=48 ALT="ActiveState PerlScript" BORDER=0></A><P>
  23. </TD></TR></TABLE>
  24.  
  25.  
  26. <h2>VBScript calling PerlScript to write output<hr>
  27.  
  28. <script language=PerlScript RUNAT=Server>
  29. sub PerlHello
  30. {
  31.     my $str = @_[0];
  32.     $Response->write($str);
  33. }
  34. </script>
  35. <blockquote>
  36. <%
  37.     response.write "VBScript says: Hello, World!<P>"
  38.     PerlHello "PerlScript says: Hello, World!<P>"
  39. %>
  40. </blockquote>
  41. </h2>
  42. <!-- +++++++++++++++++++++++++++++++++++++
  43. here is the standard showsource link - in VBScript--> <hr>
  44.  
  45. <SCRIPT LANGUAGE="PerlScript" RUNAT="Server">
  46. sub GetParams
  47. {
  48.     $url = $Request->ServerVariables('PATH_INFO')->item;
  49.     $params = 'filename=vbs-pl-hello.asp&URL='."$url";
  50.     $params =~ s#([^a-zA-Z0-9&_.:%/-\\]{1})#uc '%' . unpack('H2', $1)#eg;
  51.       $Response->write($params);
  52. }
  53. </SCRIPT>
  54. <A HREF="index.htm"> Return </A>
  55. <A HREF="showsource.asp?<% GetParams %>">
  56. <h4><i>view the source</i></h4></A>
  57.  
  58. </body>
  59. </html>
  60.