"Martin A. Hansen" wrote:
> 
> On Wed, Jan 15, 2003 at 05:34:59AM -0800, John W. Krahn wrote:
> > "Martin A. Hansen" wrote:
> > >
> > > how to use an array as input for a external command called within a perl script?
> > >
> > > im looking to pipe the array to the extarnal program ...
> >
> > open PIPE, '| somecommand' or die "Cannot open pipe to somecommand: $!";
> >
> > print PIPE @array;
> >
> > close PIPE or die "Cannot close pipe to somecommand: $!";
> 
> i figured that much, but that is not the way to solve my gnuplot problem. i
> need to translate the following commandline to perl:
> 
> (echo "set term post"; echo "plot '-' w l"; cat data) | gnuplot > data.ps
> 
> where "cat data" is replaced by a pipe of some sort ...
> 
> gnuplot is tricky because the "plot '-'" part means that the data is supplied
> followingly
> 
> gnuplot is wierd, but i hope perl can unwierd it


open PIPE, '| somecommand' or die "Cannot open pipe to somecommand: $!";

print PIPE "set term post\n", "plot '-' w l\n", @array;

close PIPE or die "Cannot close pipe to somecommand: $!";




John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to