use IO::File;
@handles = grep defined, map {
new IO::File ($_, 'r')
|| warn ($_, ': cannot open: ', $!)
&& undef
} @file_names;
while (@list = grep defined, map scalar <$_>, @handles) {
for $line (@list) {
# do stuff with line
}
}
In reply to Re: Naming file handles with variables?
by happy.barney
in thread Naming file handles with variables?
by sinee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |