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

Re^2: Weird (?) behavior with constants under special conditions

by AnomalousMonk (Chancellor)
on Jan 31, 2013 at 17:09 UTC ( #1016361=note: print w/replies, xml ) Need Help??


in reply to Re: Weird (?) behavior with constants under special conditions
in thread Weird (?) behavior with constants under special conditions

... it is not wise to use operator names for constants.

ceo: ... or for functions, which is what constants are:

>perl -wMstrict -le "sub tr (&$) { $_[0]->($_[1]) } sub trx (&$) { $_[0]->($_[1]) } ;; $_ = 'foo'; print 'A: ', tr{ print qq{tr match: $_[0]} }/foo/; print 'B: ', trx{ print qq{trx match: $_[0]} }/foo/; " A: 0 trx match: 1 B: 1

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1016361]
help
Chatterbox?
and the voices are still...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2017-07-28 13:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (429 votes). Check out past polls.