in reply to How do I run .pl script from Unix command line, and pass CGI variables to it?
On another note, check out the DBI and DBD documentation for a slightly better approach on executing sql. I prefer setting the RaiseError flag and then wrapping the actual executes in evals. That way the driver will not spill out error messages that will cause your webserver to barf - but you will have enough info to know what to do:
my $dbh = DBI->connect( "dbi:Sybase:database=xxx", "user", "pass", { RaiseError => 1 } ); eval { my $sth = $dbh->prepare( $sql ); $sth->execute(); ... }; if( $@ ) { print STDERR "An error occurred: $@\n"; } else { print "All is right\n"; }
-derby
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How do I run .pl script from Unix command line, and pass CGI variables to it?
by Lori713 (Pilgrim) on Dec 15, 2003 at 16:49 UTC |