my $winopt = {Device => '/GW', WindowWidth => 7, Aspect => 1};Afaik, this hashref is specific to PGPLOT, but you've commented out the line that will load PGPLOT - so a strange error is not unexpected. I could be wrong about this, however. As mentioned elsewhere, ask on the PDL list.
The second piece of code you posted will output a nice png file (minus the "close" image) if you set the
PGPLOT_DEV environment variable to
/PNG. The name of the output file will be pgplot.png - at least that's what happens for me. I don't know offhand what's needed to get rid of that "close" box. If I make progress with any of this later on tonight I'll update this post.
UPDATE: One simple way to avoid the "close" box is to add the line
<STDIN>; to the bottom the script.
Then, with the focus returned to the cmd.exe console, hit "Enter" when you're ready to close the graphics window, and the "close" box should appear. Or you could just do a
sleep 5; instead. In other words, that "close" box shouldn't pop into existence until the script is about to exit.
... but here:http://sourceforge.net/apps/mediawiki/pdl/index.php?title=Installing_PDL_on_Windows ..
UPDATE: What follows is rubbish - both "cpan.uwinnipeg.ca" and "theoryx5.uwinnipeg.ca" have been around for ages - and it has taken me all this time to notice that. The webpage I mention below as being in need of amendment is fine the way it is.
The information at
http://sourceforge.net/apps/mediawiki/pdl/index.php?title=Installing_PDL_on_Windows will need to be updated. There seems to have been a migration from "theoryx5.uwinnipeg.ca" to "cpan.uwinnipeg.ca" - perhaps the migration is still taking place, as the 5.6 and 5.8 repos are still under "theoryx5". I'll update that page when I find out what's going on.
Cheers,
Rob