Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Re: Re: SOP6W

by The Mad Hatter (Priest)
on Apr 25, 2003 at 22:29 UTC ( #253274=note: print w/replies, xml ) Need Help??


in reply to Re: Re: SOP6W
in thread SOP6W

Hmmm. This is a little OT, but how would you do the equivalent of print $hash{bang}; in Perl 6? print %hash{bang};?

Maybe I should start reading the Apocolypses or something...

Replies are listed 'Best First'.
Re: Re: Re: Re: SOP6W
by TheDamian (Priest) on Apr 25, 2003 at 23:54 UTC
    how would you do the equivalent of print $hash{bang}; in Perl 6? print %hash{bang};?
    Exactly. In Perl 6 the sigils for arrays (@) and hashes (%) are an intrinsic part of the variable name and consequently don't change when the variable is accessed.
    Maybe I should start reading the Apocolypses or something...
    Good idea. They're most easily accessed at: http://dev.perl.org/perl6/apocalypse/.

    The Exegeses and Synopses are also quite useful.

Re: Re: Re: Re: SOP6W
by runrig (Abbot) on Apr 25, 2003 at 23:31 UTC
    how would you do the equivalent of print $hash{bang}; in Perl 6? print %hash{bang};?
    That's right. I think sigils on hashes and arrays (when accessing elements or slices) are one of the most confusing things for beginners, and this is an effort to correct that. I think $hash{bang} can be optionally $hash.{bang} (remember "->" is changing to "."), but you can leave out the '.' since its unambiguous either way.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (1)
As of 2022-10-01 01:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer my indexes to start at:




    Results (126 votes). Check out past polls.

    Notices?