in reply to Re: Data length in strings
in thread Data length in strings

Once I encountered a problem concerning an exported peagasus mailfile. It was several hundreds of megabytes big. My oportunity was to split it into parts, each containing exactly one mail. As the file had a nice seperator, it seemed quite easy to me - but the first attempt blew up my memory. This was the first time I came to use the $_ variable instead of an own:
open(FH,"<$source") || die "cant open $source: $!\n"; while (<FH>){ push @file, $_; if ($_ =~ /^-- End --/) { $zaehler++; open(GUN,">$destiny") || die "can write to $destinyfile$zaehle +r:$!"; foreach $zeile (@file) { print GUN $zeile; }#endforeach undef @file; close(GUN); print "$zaehler:\n"; }#endif }#endwhile close(FH);

easy code, sent in the hope it helps you

there are no silly questions
killerhippy

Edit ar0n -- 2001-07-24 fixed excessive whitespace