When you're calling a CGI script as an executable, you need to simulate the work that your web server would normally do for you. In particular, it means that you need to set up your environment to match the standard setup of a CGI program. At a minimum, you'll need to do $ENV{QUERY_STRING} = 'action=task1&color=green'; I have not tried this so I don't know what the minimal number of environment variables is to make something like CGI.pm respond properly, but I would guess that you need at least REQUEST_METHOD, QUERY_STRING, and SCRIPT_NAME.
As an alternative, you can try taking the subroutines from filename.cgi that you need to reuse and stick them in a module somewhere that all your scripts can access. I suspect in the long term you'll find that an easier approach.
In reply to Re: Calling subroutine with exec() in .cgi script
by Errto
in thread Calling subroutine with exec() in .cgi script
by morbid_ru
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |