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: perldoc -q "How can I make my Perl program run faster?"
    ... > it looks like you are using ActiveState Perl ... all link to libc, you probably get more performance gain out of not ... get from static linking, particularly if it causes you to swap more. ...
    (perl.beginners)
  • Re: Trying to use Floor
    ... The ceil and floor functions are defined in the POSIX module. ... How do I ask perl what version is installed? ... you needed to install, ...
    (perl.beginners)