[RESOLVED] Perl: system call not work
I have a script to call the other script.
hello.pl
Code:
#!/usr/local/bin/perl
print("Hello " . $ARGV[0] . "\n\n");
test_hello.pl
Code:
#!/usr/local/bin/perl
$script='hello.pl';
system("$script Dave");
How can I make this possible to work for both in UNIX & Windows?
Re: Perl: system call not work
Quote:
Originally Posted by vietboy505
How can I make this possible to work for both in UNIX & Windows?
Are you getting an error from one OS?
Re: Perl: system call not work
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
Code:
$script = './hello.pl';