Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: pattern matching compilation errors

by muba (Priest)
on Jun 27, 2012 at 01:39 UTC ( #978542=note: print w/ replies, xml ) Need Help??


in reply to pattern matching compilation errors

Without wanting to repeat what others said before me, there's one part in this line that stood out to me.

open(FILE,"<",$filename1) or die "\n...Cannot find the file: $filename +";

Namely, the error message. "Cannot find the file" might not be the best to put there. There could be all sorts of other reasons the file couldn't be opened. Perhaps the process doesn't have the right permissions, maybe the file is locked, maybe there are tons of other things that could go wrong. But that's okay, because you can make Perl tell you (more or less) exactly what went wrong!

... or die "\n... Can't open $filename: $!\n";


Comment on Re: pattern matching compilation errors
Select or Download Code
Re^2: pattern matching compilation errors
by Kenosis (Priest) on Jun 27, 2012 at 01:49 UTC

    Good eye, muba!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://978542]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2014-09-17 06:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (60 votes), past polls