Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: OUT OF MEMORY!

by damian1301 (Curate)
on Aug 23, 2001 at 01:41 UTC ( [id://107158]=note: print w/replies, xml ) Need Help??


in reply to OUT OF MEMORY!

Try replacing the foreach loop with a while loop and just loop through the file. Something like this:

open(PAGES, "<pages.txt") || die $!; my @filenames; my @titles; my @headings; my @xstuff; while (<PAGES>){ if (m/^\*{4}filename.ext\*{4}/) { s/^\*{4}filename.ext\*{4}//; chomp $_; push(@filenames, $_); }elsif (m/^\*{4}title\*{4}/) { s/^\*{4}title\*{4}//; chomp $_; push(@titles, $_); }elsif (m/^\*{4}heading\*{4}/) { s/^\*{4}heading\*{4}//; chomp $_; push(@headings, $_); }else { push(@xstuff, $_); } } close PAGES;


$_.=($=+(6<<1));print(chr(my$a=$_));$^H=$_+$_;$_=$^H; print chr($_-39); # Easy but its ok.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://107158]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-25 19:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found