home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1999 April
/
PCWorld_1999-04_cd.bin
/
Software
/
TemaCD
/
14all
/
perl.txt
< prev
next >
Wrap
Text File
|
1998-02-21
|
3KB
|
93 lines
Perl support in 1-4-All
*~*~*~*~*~*~*~*~*~*~*~*
Perl support is in beta stage and disabled as default.
To enable it, rename the file "perlwords.da_" to
"perlworlds.dat". Do not edit this file!
(Re)Start 1-4-All.
I suggest to enable 1-4-All's backup option while the
perl support is in beta stage.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
If you enable perl support, please take the time to
report all problems to support@mmsoftware.com. Thanks!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
*** General info:
When you open a perl file (.pl or .cgi extension) you
will get a new main menu entry "Perl" and the file will
be color coded to Perl syntax.
*** Executing scripts:
(Was tested with Perl for Win32 Build 306 (Perl 5.003_07),
but should work with other versions. Let me know if not.)
If you have Perl installed on your machine, you can
execute the current script and redirect the output to
1-4-All's message frame, it's internal or one of the
external browsers.
Select "Perl|Execute" and enter all options and paramters to
pass. Select "Perl|Execute again" to run the current script
with the previously used options and parameters.
If you select to redirect the output to 1-4-All's message
frame and a line of output refers to a line in the script,
you can double-click in the message frame to jump to that
line in the script.
On execution a copy of the current script is saved with
the ".tmp" extension and this copy is actually executed, not
the original file.
*** Passing parameters by ENV parameters:
Perl scripts used on the WWW get their parameters through
ENV variables, defined in the CGI specification, and NOT
by the command line.
To find out more about CGI and defined ENV variables, see:
http://hoohoo.ncsa.uiuc.edu/cgi/
http://hoohoo.ncsa.uiuc.edu/cgi/interface.html
A script that simply shows all ENV variables passed from
your browser can be found at:
http://hoohoo.ncsa.uiuc.edu/cgi-bin/test-cgi/extra/path?a+query
To pass ENV parameters to your script, select "Perl|Execute",
click on "ENV paramters" and enter all ENV parameters your
perl script needs.
The ENViroment paramter QUERY_STRING starts without the
question mark seen in URLs, e.g. in the URL (I made that up...)
"http://www.cooking.com/cgi/recipesearch.pl?term=onions&maxhits=30"
QUERY_STRING is set to "term=onions&maxhits=30" and that's what
you would enter in the QUERY_STRING field of the "Execute perl
script" window.
How are the ENV values actually passed you ask? Open the
<scriptname>.tmp file that is created for execution (and deleted
when 1-4-All is closed) and examine the code. Note the call to
the subroutine in the first line and examine the subroutine at
the end of the file. Cheap trick...
*** Passing parameters by command line:
If you select to pass parameters by the command line,
1-4-All will execute:
<Path_to_perl> -s <scriptname> -<your_parameters>
e.g.:
C:\Perl\bin\Perl.exe -s myscript.tmp -color1=green
*EOF*