Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Pattern for a shell-style call + error response

by ash (Monk)
on May 05, 2007 at 12:06 UTC ( [id://613716]=note: print w/replies, xml ) Need Help??


in reply to Pattern for a shell-style call + error response

One common method in other languages is:
my $ret = $item->frobinize(...); die "Error occured." if $ret;
It's clean and simple. I like it better than 'and'.

-- 
asksh <ask@0x61736b.net>

Replies are listed 'Best First'.
Re^2: Pattern for a shell-style call + error response
by djp (Hermit) on May 07, 2007 at 02:06 UTC
    The advantage of this method is that you get a handle on $ret, which will usually have some meaning. So you can print it in an error message, or something.

Log In?
Username:
Password:

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

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

    No recent polls found