Click to See Complete Forum and Search --> : [RESOLVED] Perl: system call not work


vietboy505
February 28th, 2006, 08:51 AM
I have a script to call the other script.

hello.pl

#!/usr/local/bin/perl

print("Hello " . $ARGV[0] . "\n\n");



test_hello.pl

#!/usr/local/bin/perl

$script='hello.pl';
system("$script Dave");


How can I make this possible to work for both in UNIX & Windows?

PeejAvery
February 28th, 2006, 08:41 PM
How can I make this possible to work for both in UNIX & Windows?
Are you getting an error from one OS?

mmetzger
February 28th, 2006, 08:53 PM
The problem is it can't find the hello.pl script. Your current code will work on windows. To make it work on Linux - etc, change it to


$script = './hello.pl';