Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

What happened to dor and err in Perl 5.10?

by tomfahle (Priest)
on Jan 05, 2008 at 08:36 UTC ( #660524=perlquestion: print w/replies, xml ) Need Help??

tomfahle has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

What's the reason for not implementing the low precedence operators dor and err in 5.10?

Thanks.

  • Comment on What happened to dor and err in Perl 5.10?

Replies are listed 'Best First'.
Re: What happened to dor and err in Perl 5.10?
by hipowls (Curate) on Jan 05, 2008 at 10:33 UTC

    use feature 'dor' was an alias for use feature 'err', there wasn't a dor keyword.

    There is a longish thread at http://www.nntp.perl.org/group/perl.perl5.porters/2007/09/msg128170.html which discusses the reason for removing the err keyword. It boils down to people associating err with errors and therefore too likely to clash with current practice and confuse those new to the operator.

    The // operator remains and since it doesn't clash syntactically with the earlier use of // (one is an operator the other a term) there is no need for use feature 'err'.

    Update: as pointed out by ysth below I'd missed the significance of http://www.nntp.perl.org/group/perl.perl5.porters/2007/09/msg128324.html where Rafael Garcia-Suarez writes "Larry decided to rename err to orelse in Perl 6.". Thanks to ysth for pointing it out.

      It boils down to people associating err with errors and therefore too likely to clash with current practice and confuse those new to the operator.
      No, that's not what it boils down to. That thread contains that (and other) complaints, but the real killer was that perl6 won't have an err; it will have an orelse operator instead, that apparently will be functionally different from a low-precedence //.

      Thank you. That's exactly what I am looking for.

        Just like or is almost only be useful in structures of the form

        func arg or stmt;

        err would almost only be useful in structures of the form

        func arg err stmt;

        Simply replacing err with // would be wrong, but appropriate use of parens will do the trick:

        func(arg) // stmt;
        (func arg) // stmt;
        if (not defined func arg) { stmt; }

        etc.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2021-12-04 02:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (30 votes). Check out past polls.

    Notices?