in reply to Breaking huge text file apart
If the file is small enough to fit in memory, then you could do something like this:
If you don't want to read the whole thing into memory in one go, you could do something like this:my $pattern = "----- blah de blah ----"; do_whatever($_) foreach split /$pattern/, join '', <> ;
andy.{ local $/ = "----- blah de blah ----"; while (my $this_section = <>) { chomp $this_section; do_whatever($this_section); } }
|
|---|