in reply to Perl Script Calling Another Perl Script

Here is one way to skin this cat:
# program one (one.pl) my $gimme = system('./two.pl','foo','bar'); # program two (two.pl) print join(':',@ARGV),"\n";
Program two needs to print to STDOUT, not return.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: Re: Perl Script Calling Another Perl Script
by mcogan1966 (Monk) on Nov 20, 2003 at 20:41 UTC
    Yup, as if the universe decided to prank on me (like when is it not), the answer basically fell into my lap just minutes after posting this.

    In program one:

    $out = `perl program2.pl "$var1" "$var2"`;
    And in program two:
    $output = "blah"; print $output;
    And of course, it all works just fine for me.

    *returns to banging head on desk