S
Stefano Sabatini
Hi all perlers,
I'm writing a perl script which reads from stdin, then launch an
interactive session of gnuplot. I'm on a gnu-linux system, perl 5.8.
The simplified code looks like this:
#! /usr/bin/perl
# reads from stdin, then lauch interactively gnuplot
open(FH, "/dev/stdin");
# filter stdin
while (<FH>) {
;
}
close(FH);
print "Launching gnuplot...\n";
# and now launch a gnuplot interactive session
system "gnuplot -";
If I feed the script with a file, like this:
cat file.txt | perl gnuplot-launcher.pl
gnuplot exits immediately from the interactive session.
If I filter a regular file (like "file.txt") or type interactively on
stdin like this:
cat - | gnuplot-launcher.pl
I'm writing
interactively
on
stdin
^D
then the gnuplot interactive mode seems to work.
All I want to do is to be able to access to an interactive session of
gnuplot from perl, but I'm evidently missing something.
Many thanks in advance.
Cheers.
I'm writing a perl script which reads from stdin, then launch an
interactive session of gnuplot. I'm on a gnu-linux system, perl 5.8.
The simplified code looks like this:
#! /usr/bin/perl
# reads from stdin, then lauch interactively gnuplot
open(FH, "/dev/stdin");
# filter stdin
while (<FH>) {
;
}
close(FH);
print "Launching gnuplot...\n";
# and now launch a gnuplot interactive session
system "gnuplot -";
If I feed the script with a file, like this:
cat file.txt | perl gnuplot-launcher.pl
gnuplot exits immediately from the interactive session.
If I filter a regular file (like "file.txt") or type interactively on
stdin like this:
cat - | gnuplot-launcher.pl
I'm writing
interactively
on
stdin
^D
then the gnuplot interactive mode seems to work.
All I want to do is to be able to access to an interactive session of
gnuplot from perl, but I'm evidently missing something.
Many thanks in advance.
Cheers.