Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: (tye)Re2: Cheap idioms

by Aragorn (Curate)
on Oct 14, 2002 at 06:51 UTC ( #204988=note: print w/ replies, xml ) Need Help??

in reply to (tye)Re2: Cheap idioms
in thread Cheap idioms

Oh, I like this idiom, but strictly in stand-alone scripts. Bombing out of a program deep inside some library doesn't sit well with me.

And Perl exits with the following error message if the file doesn't exist using this idiom:
Can't open /does/not/exist: No such file or directory.
Uhm. I can do that :-)

Comment on Re: (tye)Re2: Cheap idioms
Download Code
Replies are listed 'Best First'.
(tye)Re3: Cheap idioms
by tye (Sage) on Oct 14, 2002 at 15:37 UTC

    Yes, it doesn't seem hard at all does it? (:

    It includes a description of what was being attempted ("open", though I'd probably opt for metioning that "read" access is what was required -- though I can understand not wanting to confuse people into thinking it was a read operation that failed while keeping the message short), the input data to the operation (the name of the file), and the correct error code indicating why it failed ($! in this case).

    Unfortunately, that still makes it above average in my experience. ):

            - tye (who doesn't like error messages a la mode)

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2015-11-30 01:36 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (755 votes), past polls