Help for this page

Select Code to Download


  1. or download this
    my @a = (1 .. 5);
    say $a[0];       # '$' sigil, we are picking out a scalar
    say @a[3,1,2];   # '@' sigil, we are picking out a list (an array-like
    + structure)
    ...
    say $h{a};       # '$' sigil, we are picking out a scalar
    say @h{qw{b c}}; # '@' sigil, we are picking out a list
    say %h{qw{a c}}; # '%' sigil, we are picking out a hash slice (a hash-
    +like structure)
    
  2. or download this
    my $aref = [ 1 .. 5 ];
    say $aref->[0];  # or ${$aref}[1]
    say @{$aref}[3,1,2];
    ...
    say $href->{a};  # or ${$href}{a}
    say @{$href}{qw{b c}};
    say %{$href}{qw{a c}};