Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: pattern matching compilation errors

by muba (Priest)
on Jun 27, 2012 at 01:39 UTC ( [id://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";

Replies are listed 'Best First'.
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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://978542]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (7)
As of 2024-04-24 12:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found