Remember: the value of $/ is a string, not a regex.Your .* are regular expression syntax, but they are treated as a literal dot followed by a literal asterisk when assigned to the input record separator special variable.
If you want to avoid slurping your entire file into memory at once, you could operate on 3 lines at a time by creating a 3-line buffer:
use warnings; use strict; my @lines; while (<>) { push @lines, $_; if ($. % 3 == 0) { # do something with @lines; @lines = (); } }
In reply to Re: input record separator
by toolic
in thread input record separator
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |