Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: What happened to dor and err in Perl 5.10?

by hipowls (Curate)
on Jan 05, 2008 at 10:33 UTC ( #660526=note: print w/replies, xml ) Need Help??


in reply to What happened to dor and err in Perl 5.10?

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.

Replies are listed 'Best First'.
Re^2: What happened to dor and err in Perl 5.10?
by ysth (Canon) on Jan 06, 2008 at 02:10 UTC
    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 //.
Re^2: What happened to dor and err in Perl 5.10?
by tomfahle (Priest) on Jan 05, 2008 at 13:05 UTC

    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: note [id://660526]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2021-11-27 11:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?