Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Potential Ternary Operator Bug

by merlyn (Sage)
on Dec 10, 2001 at 21:13 UTC ( #130708=note: print w/ replies, xml ) Need Help??


in reply to Potential Ternary Operator Bug

My hunch is that this "works" in the same way that @a->[3] "works", in that an array name is sometimes automatically a reference to that array, even though the language definition would argue otherwise. I've heard it would take deep voodoo to get the current interpreter to have the right info to reject that, so we'll have to wait until perl 6, where it'll be blessed instead of cursed. {grin}

-- Randal L. Schwartz, Perl hacker


Comment on Re: Potential Ternary Operator Bug
Download Code
Re: Re: Potential Ternary Operator Bug
by robin (Chaplain) on Dec 11, 2001 at 18:49 UTC
    It's actually very easy to get the interpreter to reject @a->[3] - I'm not sure how the rumour that it's hard began. I wrote a very simple patch, which is in bleadperl, to deprecate that usage:

    [robin@penderel perl@12959]$ ./perl -we '@x->[2]'
    Using an array as a reference is deprecated at -e line 1.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://130708]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (8)
As of 2014-04-20 15:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls