perl - perl6: do I need the @-sigil for userdefined variables? -


is there can't without '@'-sigil when working user-defined variables?

#!perl6 use v6;  $list = <a b c d e f>; @list = <a b c d e f>;  $list.list.perl.say; @list.perl.say;   $list[2..4].say; @list[2..4].say;  $list.elems.say; @list.elems.say;  $list.end.say; @list.end.say;  'ok' if $list ~~ /^c$/; 'ok' if @list ~~ /^c$/; 

yes, variadic parameters require @ sigil:

sub shout(*@a) {       print @a>>.uc; } 

though that's cheating question, because @a formal parameter, not variable. actual variables only, scalars can need, though more effort if use appropriate sigil.


Comments

Popular posts from this blog

apache - Add omitted ? to URLs -

redirect - bbPress Forum - rewrite to wwww.mysite prohibits login -

php - How can I stop spam on my custom forum/blog? -