ezekiel has asked for the wisdom of the Perl Monks concerning the following question:
I have a quick and dirty script to check the integrity of several data files. I send a list of files as arguments to the script on the command line e.g
script.perl file1 file2 file3
An outline of the script is:
while (<>) { chomp; # ... verify the line ... die unless ($verified); }
When the program dies, it reports what line it was working on, but not which file the line is contained in. Is there a simple way to extract this information? (I can easily rewrite the script to get a list of filenames and then loop over them, but I was wondering if there is a simpler method.)
Thanks.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Working out which file a script is working on
by japhy (Canon) on Jul 10, 2001 at 09:27 UTC | |
Re: Working out which file a script is working on
by danger (Priest) on Jul 10, 2001 at 09:50 UTC | |
(crazyinsomniac) Re: Working out which file a script is working on
by crazyinsomniac (Prior) on Jul 10, 2001 at 09:24 UTC |