in reply to How to execute external script from CGI
There are a million places to find informatin on modulinos, it's pretty much as simple as:use FindBin ($Bin); require qq{$Bin/relative/../path/to/loadCSV.pl}; my $out = your::modulino->run( (qw/-L -Q/) ); print $out;
The above is dirty, but better what you're doing. And it provides the basis for really creating a well done modulino. Or better yet, an actual Perl module where the CLI version becomes a 3 line script calling the dern module you just peared off.package your::modulino; use strict; use warnings; # Note: I know this is awful but it's better than what OP is doing now print __PACKAGE__->run(\@ARVG) if not caller; sub run { my $self = shift; local @ARGV = @_; # shove nearly all loadCVS.pl in here, getopt and all with ONE excep +tion # ... # convert all of your "print" statements such they create the string + you # were going to print, then: return $formerly_printed_stuff; } 1;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to execute external script from CGI
by vskatusa (Acolyte) on May 22, 2020 at 13:45 UTC | |
by perlfan (Parson) on May 23, 2020 at 18:07 UTC | |
|
Re^2: How to execute external script from CGI
by Anonymous Monk on May 22, 2020 at 09:24 UTC | |
by perlfan (Parson) on May 22, 2020 at 12:12 UTC | |
|