Not that I know of.... You could consider using the open command, and running the script as a thread such as:
open (FH, "yourfile.pl -h");
close(FH);
You could also use the system command, but it would seem to me that shelling no matter how you do it is going to take a bit of processing time.
Comatose
Taboo Programmer
2,910 posts since Dec 2004
Reputation Points: 361
Solved Threads: 215
You can pass command line arguments by changing @ARGV. It is best to make a local copy.
For example,
inc.pl:
#!/usr/bin/perl
use strict; # just for kicks
for my $item (@ARGV) {
print "$item\n"; # print what we think are our command line args!
}
tmp.pl:
#!/usr/bin/perl
use strict; # just for kicks
{
local @ARGV;
@ARGV = (1, 2, 3, 4, "Hello!"); # set our command line args!
eval { require "inc.pl" };
# the 'eval' catches the exception that occurs when
# inc.pl fails to return true (which can also be alleviated
# by ending "inc.pl" with a true value, such as 1; in a
# line by itself).
}
print "\nOriginal Arguments:\n\n";
for my $item (@ARGV) {
print "$item\n";
}
If you run:
perl tmp.pl arg1 arg2 arg3
you'll see the output1
2
3
4
Hello!
Original Arguments:
arg1
arg2
arg3
Rashakil Fol
Super Senior Demiposter
2,658 posts since Jun 2005
Reputation Points: 1,135
Solved Threads: 177