seaver has asked for the wisdom of the Perl Monks concerning the following question:
THere's probably a more convoluted way of catching errors, and using __FILE__ to warn, but I was just interested if this option exists:
My perl script runs through a huge number of files, all named in very similar ways. They only really differ in the paths they exist in.
My problem is that Im reducing any output, so I do NOT want to use any print statements that say 'current working path is blah blah', so my log file is truly an error file.
However, one common error occurs because of wrong naming conventions within particular files, and I need to accomodate for these naming conventions, but it takes me a long time to work out which file it is, and this is especially because my error says something like:
Can't call method "blahblah" on an undefined value at /path/to/Module. +pm line 505, <FILEDATA> line 11.
So my question is, can I get Perl to output the actual filepath, instead of the name of the filehandle?
Cheers
Sam
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Forcing perl to print filenames instead
by tinita (Parson) on Mar 30, 2004 at 16:59 UTC | |
|
Re: Forcing perl to print filenames instead
by ambrus (Abbot) on Mar 30, 2004 at 18:45 UTC | |
by seaver (Pilgrim) on Apr 08, 2004 at 18:29 UTC |