Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: open or die..

by Laurent_R (Canon)
on Feb 15, 2015 at 11:57 UTC ( [id://1116782]=note: print w/replies, xml ) Need Help??


in reply to Re: open or die..
in thread open or die..

Yes, an exception is raised, but why doesn't it print the message that is given as a param to the die built-in? I would expect that.

For example:

$ perl -e 'open my $FOO, "<", "foo2.txt" or die "Could not open file + foo2.txt : $!";' Could not open file foo2.txt : No such file or directory at -e line 1.

Je suis Charlie.

Replies are listed 'Best First'.
Re^3: open or die..
by Corion (Patriarch) on Feb 15, 2015 at 11:58 UTC

    I completely missed that the error message as caught was not the error message as (should have been) raised.

Log In?
Username:
Password:

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

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

    No recent polls found