Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by ash (Monk)
on May 05, 2007 at 12:06 UTC ( #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 avoiding work at the Monastery: (5)
As of 2023-12-02 18:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (18 votes). Check out past polls.

    Notices?