Listing 1.
Plotting sin(x)/cos(x)
from within Perl

Lincoln D. Stein
"On-the-Fly Plots Made Easy"
The Perl Journal, Summer 1999
 
0 #!/usr/bin/perl

1 use strict;
2 use constant GNUPLOT => 
          '/usr/local/bin/gnuplot';
                  
3 open (GP,'|'.GNUPLOT) || die "Gnuplot: $!";
4 print GP "set terminal gif\n";
5 print GP "plot sin(x)/cos(x)\n";
6 close GP