in reply to Slurping a large (>65 gb) into buffer
Hi,
I'd use the $/ (a.k.a. $INPUT_RECORD_SEPARATOR) variable to set to the line that separates the html pages and read one "page" at a time:
Regards,
svenXY
PS: --who on earth puts 65GB of HTML pages in one file?
I'd use the $/ (a.k.a. $INPUT_RECORD_SEPARATOR) variable to set to the line that separates the html pages and read one "page" at a time:
#!/usr/bin/perl use strict; use warnings; $/ = '---this line is the separator---'; while (<DATA>) { $_ =~ s#$/##; # strip the separator line print "Data to process: \n$_\n"; } __DATA__ <html> <body>file 1</body> </html> ---this line is the separator--- <html> <body>file 2</body> </html> ---this line is the separator--- <html> <body>file 3</body> </html> ---this line is the separator--- <html> <body>file 4</body> </html> ---this line is the separator--- <html> <body>file 5</body> </html> ---this line is the separator---
Regards,
svenXY
PS: --who on earth puts 65GB of HTML pages in one file?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Slurping a large (>65 gb) into buffer
by tcf03 (Deacon) on Oct 01, 2007 at 16:26 UTC |
In Section
Seekers of Perl Wisdom