develooper Front page | perl.beginners | Postings from January 2002

Re: Calling a perl script with a perl script

Thread Previous | Thread Next
From:
Connie Chan
Date:
January 4, 2002 06:31
Subject:
Re: Calling a perl script with a perl script
Message ID:
007101c1952b$f7189400$9918fea9@omega
# program main.pl
require "testprog.pl";
@data = add1( 100, 1000, 10000);

# program testprog.pl
sub add1($,$,$)
{
    my ($a, $b, $c) = @_;
    $a++ ; $b++ ; $c++;
    return ($a, $b, $c)
}

when you run main.pl, you got @data = (101, 1001, 10001)

have a nice day =)

----- Original Message -----
From: "Hubert Ian M. Tabug" <htabug@mydestiny.net>
To: "Perl" <beginners@perl.org>
Sent: Friday, January 04, 2002 2:15 PM
Subject: Calling a perl script with a perl script


Hi,

        Given that I have a perl script main.pl, and I want main.pl to
"use/call" the script testprog.pl, and store testprog.pl's output into a
variable that can be used within main.pl. How do I go about doing it? Your
help would be greatly appreciated.

Thanks,
Hubert



Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About