open infile, "< datafile"; my $str = join "", ; close infile; gnuplot (..., $str);