On 27/01/2012 12:58, Nemana, Satya wrote:
Hi Shawn
How do I use this option of -MO=Deparse when executing a perl script
with an embedded #! Prompt?
Our scripts start with the line
#!/ats/bin/perl -w
I tried adding the parameters here, but got the following errors
Too late for "-MO=Deparse" option at ./startAutomation line 1.
BEGIN { $^W = 1; }
Then there are a host of other environment variables set before
executing the functions in the modules by a call to
unless ( my $return_val = do $test_suite_list_file ) {
die "ERROR: Couldn't parse test suite file \"$test_suite_list_file\":
$@\n" if $@;
die "ERROR: Couldn't 'do' test suite file \"$test_suite_list_file\": $!\n"
unless defined $return_val;
die "ERROR: Couldn't run test suite file \"$test_suite_list_file\": $!\n"
unless $return_val;
is there other way of using the option -MO=Deparse??
No, the module has to be mentioned on the comnmand line, but you can say
/ats/bin/perl -w -MO=Deparse prog.pl
which will have the desired effect. You can also add the additional
files in the same command if necessary using the -f option like this
/ats/bin/perl -w -MO=Deparse -f file1.pl -f file2.pl prog.pl
Also you should be using
use warnings;
instead of -w in the #! line.
HTH,
Rob
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/