Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

system call not work 2

Status
Not open for further replies.

vietboy505

Technical User
Feb 20, 2006
56
US
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?
 
usually windows uses a different shebang line than Unix. Depending on how windows is setup and which version of windows, a shebang line might not even be necessary.
 
Even those two scripts don't work in Unix either.
 
try like this:

$script = 'perl hello.pl';
system("$script Dave");
 
Unless its a typo, the shebang is supposed to be on the very first line, not?

For windows you need a file association set up for .pl The shebang is ignored.

\0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top