Gnuplot::Builder::TempFile - gnuplot wrapper using temporary files
use Gnuplot::Builder::Process; @Gnuplot::Builder::Process::COMMAND = qw(gnuplot_builder_tempfile_wrapper wgnuplot --persist);
Gnuplot::Builder::TempFile is an implementation of gnuplot_builder_tempfile_wrapper command bundled in this distribution.
gnuplot_builder_tempfile_wrapper
gnuplot_builder_tempfile_wrapper wraps a gnuplot process with a temporary file. It receives script text from STDIN, stores the text into the temporary file and executes the real gnuplot with the temporary file. It also tries to clean up the temporary file it created.
Note that gnuplot_builder_tempfile_wrapper discards output (STDOUT and STDERR) from the real gnuplot process. This means you cannot see diagnostic messages if something goes wrong in the gnuplot process.
gnuplot_builder_tempfile_wrapper is meant to be used with Gnuplot::Builder as a replacement of the real gnuplot command. See the "SYNOPSIS" section for usage.
Usually you don't. I guess it is more efficient to stream script into the real gnuplot process.
However, in some platforms (such as Windows) gnuplot behaves strangely when you stream script through a pipe. I found it especially difficult to keep plot windows open, so I created this.
If you are in trouble with Windows gnuplot, Gnuplot::Builder::Wgnuplot may help.
All functions are exported only by request.
This function executes the following steps.
Open a temporary file.
Receive data from STDIN and write the data to the temporary file.
After STDIN is closed, execute @gnuplot_command in a separate process with the path to the temporary file appended to the arguments.
@gnuplot_command
This is basically the same as
system(@gnuplot_command, $path_to_temp_file);
except that it won't wait for the process to finish.
If @gnuplot_command is empty, it uses ("gnuplot", "--persist") by default.
("gnuplot", "--persist")
Execute gnuplot_builder_tempfile_remover bundled in this distribution in a seprate process.
gnuplot_builder_tempfile_remover
system("gnuplot_builder_tempfile_remover", $path_to_temp_file);
gnuplot_builder_tempfile_remover removes the temporary file after waiting for a while, then exits.
Gnuplot::Builder
Gnuplot::Builder::Wgnuplot
https://github.com/debug-ito/Gnuplot-Builder-TempFile
Please report bugs and feature requests to my Github issues https://github.com/debug-ito/Gnuplot-Builder-TempFile/issues.
Although I prefer Github, non-Github users can use CPAN RT https://rt.cpan.org/Public/Dist/Display.html?Name=Gnuplot-Builder-TempFile. Please send email to bug-Gnuplot-Builder-TempFile at rt.cpan.org to report bugs if you do not have CPAN RT account.
bug-Gnuplot-Builder-TempFile at rt.cpan.org
Toshio Ito, <toshioito at cpan.org>
<toshioito at cpan.org>
Copyright 2014 Toshio Ito.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install Gnuplot::Builder::TempFile, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Gnuplot::Builder::TempFile
CPAN shell
perl -MCPAN -e shell install Gnuplot::Builder::TempFile
For more information on module installation, please visit the detailed CPAN module installation guide.