#!/usr/bin/perl # for more accurate per request time accounting BEGIN { eval "use Time::HiRes"; $Apache::ASP::QuickStartTime = eval { &Time::HiRes::time(); } || time(); } # help section use File::Basename; use Getopt::Std; use Cwd; use Carp qw(confess); use Apache::ASP::CGI; =pod =head1 NAME asp-perl - Apache::ASP CGI and command line script processor =head1 SYNOPSIS asp-perl [-hsdb] [-f asp.conf] [-o directory] file1 @arguments file2 @arguments ... -h Help you are getting now! -f Specify an alternate configuration file other than ./asp.conf -s Setup $Session and $Application state for script. -d Set to debug code upon errors. -b Only return body of document, no headers. -o Output directory, writes to files there instead of STDOUT -p GlobalPackage config, what perl package are the scripts compiled in. =head1 DESCRIPTION This program will run Apache::ASP scripts from the command line. Each file that is specified will be run, and the $Request->QueryString() and $Request->Form() data will be initialized by the @arguments following the script file name. The @arguments will be written as space separated words, and will be initialized as an associate array where %arguments = @arguments. As an example: asp-perl file.asp key1 value1 key2 value2 would be similar to calling the file.asp in a web environment like /file.asp?key1=value1&key2=value2 The asp.conf script will be read from the current directory for parameters that would be set with PerlSetVar normally under mod_perl. For more information on how to configure the asp.conf file, please see < http://www.apache-asp.org/cgi.html > =head1 SEE ALSO perldoc Apache::ASP, and also http://www.apache-asp.org =head1 COPYRIGHT Copyright 1998-2004 Joshua Chamas, Chamas Enterprises Inc. This program is distributed under the GPL. Please see the LICENSE file in the Apache::ASP distribution for more information. =cut $SIG{__DIE__} = \&confess; getopts('hsdbo:p:f:'); if($opt_h || ! @ARGV) { open(SCRIPT, $0) || die("can't open $0 for reading: $!"); my $script = join('',