[Pdx-pm] question: moving script from unix to windows

aspen 108 aspen_108 at hotmail.com
Mon Jun 7 16:39:36 CDT 2004


I generally use my perl scripts with unix.  I now want to use one script 
with activestate perl in windows, since I recently learned how to get the GD 
module to do true type fonts there.

So, I transferred my script over and made two changes:
1.) Changed input file addresses so windows recognizes them - works fine.
2.) Changed GD string commands to get true type fonts.

I confirmed that these were the only changes by comparing original and 
changed files with the unix "diff" command.

I have a loop that outputs files sequentially, starting with 1 and going 
upwards to over 1000.  It has always worked fine in unix.  Now in windows, 
the script will work fine for a while, then it will die and say "unable to 
open 27.png..." after perfectly opening and putting out the first 26 with 
lovely true type fonts.  Here's where the output happens.

sub PrintPNG {
    my($graph_num) = @_;
    my($png_file);

    $png_file = $graph_num . ".png";
    open (PNG, ">$png_file") || die "unable to open $png_file";
    binmode PNG;
    print PNG $image->png;
    close (PNG) || warn "unable to close $png_file";
}


A little more info that doesn't make sense...  I tried commenting-out some 
of the new true type string commands.  If they're all off, the script runs 
fine and there is no error with opening files.  If some/all are on, the 
script dies, and the output file number on which it dies (e.g. 27.png, 
127.png, etc.) changes.  An example of the innocuous-looking true type 
command is:

$image->stringTTF($black, $font, 14, 0, 500, 50, "hello");

(where the 4 numbers stand for font size, angle, x and y coords)


Thanks for reading to the end.  I can't figure out why the output files 
won't open.  Does anyone have insight?

Thank you,

Annett :)

_________________________________________________________________
Get fast, reliable Internet access with MSN 9 Dial-up – now 3 months FREE! 
http://join.msn.click-url.com/go/onm00200361ave/direct/01/




More information about the Pdx-pm-list mailing list