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
Post a Comment