in reply to How do I read the files in @ARGV one by one
How do you distinguish filenames from contents of files in your data structure? A hash of arrays is cleaner.
The following snippet should work:
The purpose of the first line is to make sure that files which are empty are included in your hash.$data{$_} = [] foreach @ARGV; while (<>) { push @{$data{$ARGV}}, $_; }
|
---|
In Section
Seekers of Perl Wisdom