Algorithmically golfed: (golfed without employing space-saving techniques, otherwise it would look scary :P)
open (OLD, "<$old_file.txt") || die $!; my $i; foreach (split (/====\s*\n(?=\d+)/, do{local$/;<OLD>})) { open (NEW,">$old_file$i.txt") || die $!; print NEW $_; close (NEW); $i++; }
In reply to Re: To regex or not to regex
by jryan
in thread To regex or not to regex
by mndoci
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |