[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] MacPerl Version



Weston Houghton/Unsane,weslists@anapraxis.com,Internet writes:
>does anyone have 
>any hints on using CGI.pm with MacPerl

The only hint I have is make sure CGI.pm is saved as a Mac file. I know it's
painfully obvious, but if you're using BBEdit (like I am - CGI.pm is too big
for MacPerl), CGI.pm will automatically be shown nicely, even though it's in
UNIX format. It drove me crazy for a while, until I figured out that CGI.pm had
UNIX end-of-lines. MacPerl couldn't handle it, and I had no idea why it wasn't
working.

Anyways, use BBEdit to change the format, or write a script to change the
end-of-line characters.

open(CGI, "CGI.pm") or die "Dead!\n$!\n";
open(NEW, ">CGI.pm NEW") or die "Dead!\n$!\n";
@lines = <CGI>;
close(CGI);

foreach $line (@lines) {
   $line =~ s/\r/\n/gm;
}
>

print NEW join("", @lines);
close(NEW);

-----------------------------------------------------------------
                       Open Learning Agency
4355 Mathissi Place, Burnaby, B.C. Canada, V5G 4S8 (604) 431-3000


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch