Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Perl 6 version of cheatsheet

by xenchu (Friar)
on Nov 16, 2003 at 21:15 UTC ( #307498=note: print w/ replies, xml ) Need Help??


in reply to Perl 6 version of cheatsheet
in thread perlcheat

I may just be 'not getting it' as usual, but shouldn't the line:

element: @array[0] %hash{'a'}
instead be:
element: $array[0] $hash{'a'}
Or is that a Perl 6 change?

Thanks,
xenchu


Comment on Re: Perl 6 version of cheatsheet
Select or Download Code
Replies are listed 'Best First'.
Re^2: Perl 6 version of cheatsheet
by adrianh (Chancellor) on Nov 16, 2003 at 21:48 UTC

    It's a Perl 6 change :-)

      To be more verbose, in perl6 the sigils become part of the variable name. Everywhere you talk about @array, it will have the '@'. $array[5] instead is the 5th element of the array whose array ref is stored in the scalar $array ($array->[5] in perl5-speak.).
        I have to say: keeping the same sigil regardless of whether you're accessing elements or the whole thing is going to be very helpful for newcomers.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (11)
As of 2015-07-30 21:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls