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 (Vicar) 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.