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

Re: [MacPerl-WebCGI] Can't MacPerl print more than 25.000 charw/out running out of memory?



Tom:

Great! It works!
I wish I had asked before I spent 12 hours trying to figure out what I was
doing wrong!    ... I'm fairly new to this ... :-)

While you're at it, how would you do it so that the script creates a new
BBEdit file and writes to it?  or  Emulate the behavior of the MacPerl
Output file of BBEdit? I don't know if you're familiar with this: the file
stays open instead of being saved with Perl's output. It is not a Stationary
Pad either (I tried this, but the stationary just gets written over and
doesn't stay open).

Thanks a lot for your help!

Regards,

Riccardo
--
mailto:perotti@pobox.com


> From: Thomas Wegner <toms_email@gmx.de>
> Reply-To: Thomas Wegner <toms_email@gmx.de>
> Date: Thu, 22 Jun 2000 11:42:17 +0200
> To: Riccardo Perotti <perotti@pobox.com>
> Cc: <macperl-webcgi@macperl.org>
> Subject: Re: [MacPerl-WebCGI] Can't MacPerl print more than 25.000 char w/out
> running out of memory?
> 
>> Hi All:
>> 
>> First of all: I *don't* get an Out of Memory warning or anything like that.
>> (I did read that posting and it didn't seem the same thing).
>> 
>> I get some weird output with this little script (posted below). It is a copy
>> of another one that runs fine, except the file that this one has to read has
>> probably 40 more characters (no big deal) and what this one has to print is
>> longer. Other than that, they're twin copies and the other one works ok.
>> 
>> What I get for output from MacPerl  is weird: it starts from the *middle* of
>> where it is supposed to, then prints the end and then from somewhere at the
>> beginning to somewhere in between (!!!???). Weird, weird.
>> 
>> Weirder: (1) if I make the print statement smaller, it works!
>> (2) If I use it to open the smaller file of its twin script,
>> it doesn't.
>> (3) If run it from BBedit (with the $filename specified
>> instead of the  '&StandardFile'GetFile') it works too!
>> 
>> Conclusion (?): Does Run out of memory when it has to print something
>> "large" ( 36.000 characters ?!?!?), or am I creating some kind of weird and
>> hungry loop?
>> 
>> I've increased MacPerl's memory partition. I've exported both scripts as
>> droplets. The "small" one (print=20.000 char) works, the large one doesn't.
>> I've increased the droplet's memory: nothing!
>> 
>> What to do? Yell Help!
>> 
>> Thank you
>> 
>> Riccardo
>> --
>> mailto:perotti@pobox.com
>> 
>> 
>> This is the "large" script.
>> __________________________
>> #!usr/bin/perl
>> use strict
>> require "StandardFile.pl";
>> 
>> ##Pick the File:
>> $filename = &StandardFile'GetFile("TEXT");
>> 
>> ##Open & Read the file:
>> open(INF,$filename) or die("I couldn't read the file!\n") ;
>> chomp(@datos = <INF>);
>> close(INF);
>> 
>> $i = "a";
>> foreach (@datos) {
>> @{$i++} = split(/\t/,$_);
>> }
> 
> #
> # try this:
> #
> open (OUT, ">out.test") or die "Cannot open out-file: $!";
> print OUT <<EOF;
>> 
>> ##NOTE: (here come 36.000 characters of HTML print with the variables set in
>> the foreach loop)(As said above, if lowered to aprox 25.000, it works!).
>> 
>> EOF
> 
> close(OUT); # close file
> 
>> 
>> print<<EOFooter;
>> <!--PERL SAYS: This Output is from $filename-->
>> EOFooter
>> __________________
>> 
> 
> Dear Riccardo,
> 
> there is a 32 KB barrier in both the MacPerl editor and the MacPerl
> (STDOUT-) window due to the use (and inherent restrictions) of the TextEdit
> Toolbox routines (you may know this from SimpleText). So if you try to
> output more than 32 K characters, you will get the strange behaviour you've
> described. As a workaround, you may want to print to a file (see my notes),
> which works fine.
> 
> I hope, the next version of the MacPerl-App circumvents this restriction.
> 
> Best regards
> 
> --Thomas
> 
> 
> 
> 
> 
> 
> 
> 
> ==== Want to unsubscribe from this list?
> ==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org


==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-webcgi-request@macperl.org