in reply to ARGV Problem
You are calling your Perl script like this:
system('my_perl_script.pl', 'arg1', 'arg2');
This does not pass the commands to Perl or the Perl script. You need to invoke the Perl interpreter with your script as the parameter:
my @cmd = $^X, '-w', 'my_perl_script.pl', 'arg1', 'arg2'; system( @cmd ) == 0 or die "Couldn't launch @cmd: $! / $?";
If you are starting your Perl script from the command line, you also cannot start it like this:
C:\>my_perl_script.pl arg1 arg2
but you need to start it like this:
perl -w my_perl_script.pl arg1 arg2
Of course, this is guesswork based on your description. Usually it helps when you post a minimal script that exhibits the problematic behaviour, and the test cases.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: ARGV Problem
by tjdmlhw (Acolyte) on Jan 06, 2006 at 16:39 UTC | |
by ikegami (Patriarch) on Jan 06, 2006 at 16:43 UTC | |
by Celada (Monk) on Jan 06, 2006 at 21:21 UTC | |
by tjdmlhw (Acolyte) on Jan 09, 2006 at 16:37 UTC | |
by Corion (Patriarch) on Jan 06, 2006 at 16:41 UTC |