Hi, I have a scenario, which I’m working on.. Perl script 1 abc.pl--- will have two parameters, $paramter1 $paramter2 It will call another perl script 2—xyz.pl, passing the two parameters, The perl script2, will be a tcp client requesting for a service with a java server. Once the service is done, I need to return a success/error code of 0 or 1 to th main perl script abc.pl Could u please explain how to do it.. I’m a newbie.. (abc.pl) #!/usr/local/bin/perl # # composite series of images over a background image # print "\nThis is from abc.pl"; $path = "/usr/bin"; $hostName ="127.0.0.1"; $cmd = "perl xyz..pl $hostName $path"; system($cmd)== 0 or die "system $cmd failed: " ,$? >> 8; if ($? == -1) { print "\n failed to execute: $!\n"; } elsif ($? & 127) { printf "\n child died with signal %d, %s coredump\n", ($? & 127), ($? & 128) ? 'with' : 'without'; } else { printf "\nchild exited with value %d\n", $? >> 8 ; } And I need to write xyz.pl I’m able to get param from abc.pl, But how to send back the error/ success code #!/usr/local/bin/perl # # composite series of images over a background image # use IO::Socket::INET; print "\n This is in xyz.pl"; if ($#ARGV != 1) { print "usage: e2.pl hostname , pathofResults \n"; exit(2); } $hostName = $ARGV[0]; $path = $ARGV1; #is this possible??? $msg = $hostName+$path ; # Create a new socket $MySocket=new IO::Socket::INET->new(PeerPort=>5000,Proto=>'tcp',PeerAddr=>’127.0.0.1’); # Send messages to server $MySocket->send($msg); $MySocket->recv($text,1024); print "\nReceived message : ", $text,"\n"; exit (2);

In reply to Re^2: passing values to another perl program by Athahar
in thread passing values to another perl program by treebeard

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.