Re: How can i make a perl program lauch another perl program that takes options



On 6/29/07, Alex Jamestin <alex.jamestin@xxxxxxxxx> wrote:
snip
my $vplan_parent_path = "\/pdd\/qes\/vsuites\/vplan";
snip

You don't need to escape those slashes.

snip
system("perl $vplan_parent_path\/vplan_all.pl") == 0
or die "perl blew up: $!";
snip

Same thing here.

snip
And the o/p got is -

vp_all: USAGE: perl vplan_all.pl <Version> <Build> <File_name_to_be_created>

perl blew up: No such file or directory at test2.pl line 8.


Interesting thing is, while perl locates the second perl prog
successfully - it still calls die after that.
snip

You said before that it was supposed to die if it got no arguments, so
that is the expected behaviour. As to why it keeps saying "No such
file or directory", well, if I remember correctly $! is the system
call errno, not the return from system. I think you want $?
(specifically $? >> 8). Here is what I think you want

system("perl vplan_all.pl 5.6 24.0 ajtest") == 0
or die "vplan_all failed with an exit code of " . ($? >> 8);
.



Relevant Pages

  • Re: Requesting advice how to clean up C code for validating string represents integer
    ... [Java to Lisp] ... [Perl to Lisp] ...
    (comp.lang.c)
  • Re: How to use GUI: Win32::GUI If You Need Accessibility
    ... I will press a key to convert, and it should give me the converted rtf8/unicode text in another text box <snip> ... coming from a win32 api/C/C++ background. ... the exact font metrics that can be used to write resolution, font and DPI independent code in Windows apps. ... Perl will crash consistantly with a highly cryptic error message if you try to use the two at once. ...
    (comp.lang.perl.misc)
  • Re: How to use GUI: Win32::GUI If You Need Accessibility
    ... I will press a key to convert, and it should give me the converted rtf8/unicode text in another text box <snip> ... coming from a win32 api/C/C++ background. ... the exact font metrics that can be used to write resolution, font and DPI independent code in Windows apps. ... Perl will crash consistantly with a highly cryptic error message if you try to use the two at once. ...
    (comp.lang.perl.misc)
  • Re: Ternary operator
    ... to the perl maintainers) is "Where does perl document the ternary ... operator's behaviour of only evaluating either the second or the third ... is the only trinary operator. ...
    (perl.beginners)
  • Re: @array a copy of @names???
    ... It started in the 3rd edition of Learning Perl. ... That's really a foreach loop, ... least) an even worse confusion in the readers mind: ...
    (perl.beginners)