use strict; use warnings; sub do_something { print '{', $_[0], "}\n" } local $/ = ' '; while (<DATA>) { s/\n/ /; # replace end-of-line with space my @a = split(' '); # split line at spaces do_something($_) for @a; } __DATA__ 1 2 3 4 5 0 6 7 8 9 10 0
In reply to Re: Reading a huge input line in parts
by pme
in thread Reading a huge input line in parts
by kroach
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |