Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: The default hash - accident, coincidence or conspiracy?

by SimonClinch (Chaplain)
on Jun 22, 2005 at 14:07 UTC ( #469024=note: print w/ replies, xml ) Need Help??


in reply to Re: The default hash - accident, coincidence or conspiracy?
in thread The default hash - accident, coincidence or conspiracy?

Original post: Funny, I tried that out too at some time ... then I realised I just had to convert the array to hash via a list form

Foo( trouble => brewing ); sub Foo{ my %param = (@_); print "trouble is $param{ trouble }\n"; }

Update: Oops I missed the quick reference to typeglobs, otherwise I would have replied: What the post I am replying to might have said is that the typeglob *_ has been predefined in the global symbol table, not just the $_ and @_ individually - I could not find a documentation reference to %_ nor *_"


Comment on Re^2: The default hash - accident, coincidence or conspiracy?
Download Code
Re^3: The default hash - accident, coincidence or conspiracy?
by jdporter (Canon) on Jul 02, 2005 at 17:44 UTC
    No, you've completely missed kaif's point. You cannot   my %_   ever. It is illegal. By your response, your solution was to use a different variable name, not "convert the array to hash via a list form".
      Illegal? It is treated as such in the sense that it was globally reserved and thereby prevented, but until it is documented as such, it can't be called 'illegal'.

      One world, one people

        No, it is illegal, because if you put it in a perl program, the program will not run. You get a fatal error during compilation.

        For better or worse, the Perl language (unlike most) is defined by the implementation, not by a document. If the behavior in question isn't documented, that is simply a documentation bug.

        ObDisclaimer: This refers to Perl5 (and prec.) only.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2014-12-21 06:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (104 votes), past polls