in reply to Passing Data Between Perl Programs
G'day jmmitc06,
Is this the type of thing you had in mind?
"program 1 generates a variable '$number'"
$ cat var_gen.pl #!/usr/bin/env perl while (<>) { chomp; my $number = length; print "$number\n"; }
"program 2 would print $number"
$ cat var_out.pl #!/usr/bin/env perl while (<>) { print "Got $_" }
Sample run (var_gen.pl reads user input from which it generates a number which it passes to var_out.pl where the number is included in an output message):
$ var_gen.pl | var_out.pl 1 12 123 1234 12345 Got 1 Got 2 Got 3 Got 4 Got 5
-- Ken
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Passing Data Between Perl Programs
by jmmitc06 (Beadle) on Jul 05, 2013 at 05:00 UTC | |
by Preceptor (Deacon) on Jul 07, 2013 at 19:38 UTC | |
by jmmitc06 (Beadle) on Jul 30, 2013 at 04:36 UTC |