For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > June 2007 > Re: How can i make a perl program lauch another perl program that









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: How can i make a perl program lauch another perl program that
Steve Bertrand

2007-06-29, 9:58 pm

alex.jamestin+usenet@gmail.com wrote:
> Hi all,
>
> Any help on this would be appreciated :)
>
> Currently I have a perl program thats required to call another perl
> program. The second one takes arguments and can be called as:
>
> perl vplan_all.pl 5.6 24.0 ajtest
>
> Here 5.6, 24.0 and ajtest are all command line options.
>
> I have to call this from a second program that i wrote. I tried the
> call as below -
>
> system( "perl vplan_all.pl 5.6 24.0")
> or die "Couldn't run the vplan_all.pl script: $!\n";
>
> However, this doesn't seem to work. The shell reports that perl can't
> find the file. However, when i simply try with -
>
> system( "perl vplan_all.pl")
> or die "Couldn't run the vplan_all.pl script: $!\n";
>
> The script is now called and i get the result -
>
> vp_all: USAGE: perl vplan_all.pl <Version> <Build>
> <File_name_to_be_created>
>
> which is the expected behaviour when no options are provided.
> So apparently the shell calls perl and passes the entire "perl
> vplan_all.pl 5.6 24.0" as a chunk. Perl can't then seem to
> differentiate between the code name and the options.
>
> I've tried bypassing the shell [ system(xxx,xxx,xx)] but that doesn't
> seem to help.


If vplan_all.pl is in fact it's own application, try calling it without
calling Perl first:

system("/path/to/program/vp_all.pl arg1 arg2") or die "blah blah: $!";

BTW, AFAIR, inserting a \n after the $! will negate the $!, but I may be
mistaken.

Steve
Joupten82

2007-06-30, 8:27 am

Nikki Cox 16 - AmateurThumbs!

http://www.yourtubeaudio.com/MediaP...sp?clip=1673286



extreme funny and sexy video funny mobile video clip funny tube u video free download video sexy funny funny video clip joke
http://635-funny-video.info/george-...unny-video.html http://635-funny-video.info/funny-dog-video.html http://635-funny-video.info/funny-m...very-video.html http://635-funny-video.info/best-email-funny-video.html http://635-funny-video.info/free-funny-sex-video.html
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com