home *** CD-ROM | disk | FTP | other *** search
/ c't freeware shareware 1997 / CT_SW_97.ISO / pc / software / entwickl / win95 / plsei306.exe / aspSamples / vbs-pl-hello.asp < prev    next >
Text File  |  1997-03-22  |  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="ActiveWare_Hack = Dick Hardt">
  5. <!-- 
  6.     Copyright (c) 1996, Microsoft Corporation.  All rights reserved.
  7.     Developed by ActiveWare Internet Corp., http://www.ActiveWare.com
  8. -->
  9. <title>VBScript calling PerlScript - Hello, world!</title>
  10. </head>
  11. <BODY BGCOLOR=#FFFFFF>
  12.  
  13. <body>
  14. <!-- 
  15.     ActiveWare 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="ActiveWare 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.