[32936] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 4212 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 14 10:28:13 2014

Date: Wed, 14 May 2014 06:09:02 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 14 May 2014     Volume: 11 Number: 4212

Today's topics:
    Re: Help with an operator precedence (?) puzzle <news@lawshouse.org>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 13 May 2014 22:42:51 +0100
From: Henry Law <news@lawshouse.org>
Subject: Re: Help with an operator precedence (?) puzzle
Message-Id: <XqidnQRJUsNBDO_OnZ2dnUVZ8rydnZ2d@giganews.com>

On 13/05/14 17:40, Tim McDaniel wrote:
> In article <fcGdnfxQhMr3Q-zOnZ2dnUVZ8tidnZ2d@giganews.com>,
> Henry Law  <news@lawshouse.org> wrote:
>> Well, that's what I'm trying to do. But if I have a sub which has
>> multiple different ways of going wrong, how is the caller to find out
>> what the problem was?

> (0) Your sub can die on error.

> But it's a pain if the caller usually wants to continue.

Yes; various XML modules that I use do that and it is indeed a bit of a 
pain. But it's fail-safe, as you say.

>
> (2) At my $ORKPLACE, the convention in any sort of complicated
> situation is to return an anonymous hash for separate parts.
>
>      { THE_VALUE_WE_WANT_TO_RETURN_NORMALLY => 23, ERROR => '' }
>
>      { THE_VALUE_WE_WANT_TO_RETURN_NORMALLY => undef, ERROR => "Tuesday!" }
>

That's interesting.  This particular application has a "control hash" 
which is built up initially from an control file and which I then ship 
around (as a hashref) between modules and subroutines, thus avoiding 
lots of global variables, or lots of parameters to every call.  I could 
institute my own standard "last error description" within that.

Thank you for all the help, as ever.  10-7

-- 

Henry Law            Manchester, England


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 4212
***************************************


home help back first fref pref prev next nref lref last post