The argument created for gnuplot is still flawed, e.g. \tmp\L9LpBMXAW0/plot . I will dig a little deeper.

There are quite a few places that require modification. This diff isn't meant to be suitable as a patch, just an indicator of where thing need changes and what might be suitable.

For example, I have both TMP and TEMP environment variables set on my system, but I've long since forgotten whether I set up the former or whether it is set by default. I also have no idea is either is available on typical *nix systems.

And as I said earlier, to do the job right you'd have to get into moving the duplicate code into separate subroutines and using File::* modules in order to make properly cross-platform. But again, I don't know enough about these requirements to suggest anything beyond how to make it work on Win32.

Anyway, this might help you get something going. Good luck.

--- \perl\site\lib\Chart\Gnuplot.pm Wed Nov 05 15:21:26 2008 +++ Gnuplot.pm Wed Nov 05 15:33:43 2008 @@ -15,8 +15,11 @@ # Create temporary file to store Gnuplot instructions if (!defined $hash{_multiplot}) # if not in multiplot mode { - my $dirTmp = tempdir(CLEANUP => 1, DIR => '/tmp'); - $hash{_script} = "$dirTmp/plot"; +# my $dirTmp = tempdir(CLEANUP => 1, DIR => '/tmp'); + my $dirTmp = tempdir(CLEANUP => 1, DIR => $ENV{TMP} || $ENV{T +EMP} ); +# $hash{_script} = "$dirTmp/plot"; + $hash{_script} = $^O eq 'MSWin32' ? "$dirTmp\\plot" : "$dirTm +p/plot"; + } # Default terminal: postscript terminal with color drawing elemen +ts @@ -819,7 +822,8 @@ { my ($self) = @_; - my $pltTmp = "$self->{_script}/plot"; +# my $pltTmp = "$self->{_script}/plot"; + my $pltTmp = $^O eq 'MSWin32' ? "$self->{_script}\\plot" : "$self +->{_script}/plot" open(PLT, ">$pltTmp") || confess("Can't write gnuplot script $plt +Tmp"); print PLT "set terminal $self->{terminal}\n"; print PLT "set output \"$self->{output}\"\n"; @@ -1002,8 +1006,10 @@ my $ydata = $self->{ydata}; # Create temporary file to store Perl data - my $dirTmp = tempdir(CLEANUP => 1, DIR => '/tmp'); - my $fileTmp = "$dirTmp/data"; +# my $dirTmp = tempdir(CLEANUP => 1, DIR => '/tmp'); + my $dirTmp = tempdir(CLEANUP => 1, DIR => $ENV{TMP} || $ENV{T +EMP} ); +# my $fileTmp = "$dirTmp/data"; + my $fileTmp = $^O eq 'MSWin32' ? "$self->{_script}\\data" : " +$dirTmp/data"; open(DATA, ">$fileTmp") || confess("Can't write data to temp +file"); # Process 3D data set @@ -1215,8 +1221,10 @@ { my $pt = $self->{points}; - my $dirTmp = tempdir(CLEANUP => 1, DIR => '/tmp'); - my $fileTmp = "$dirTmp/data"; +# my $dirTmp = tempdir(CLEANUP => 1, DIR => '/tmp'); + my $dirTmp = tempdir(CLEANUP => 1, DIR => $ENV{TMP} || $ENV{T +EMP} ); +# my $fileTmp = "$dirTmp/data"; + my $fileTmp = $^O eq 'MSWin32' ? "$self->{_script}\\data" : " +$dirTmp/data"; open(DATA, ">$fileTmp") || confess("Can't write data to temp +file"); # 2D data points

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re^5: Chart::Gnuplot and Windows XP by BrowserUk
in thread Chart::Gnuplot and Windows XP by dHarry

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.