Help for this page

Select Code to Download


  1. or download this
    
    my %hash = (
    ...
    sub foo {
       print join(' | ', @_), "\n";
    }
    
  2. or download this
    sub foo {
        my %hash = @_;
    ...
    
    # not good at all
    foo(@names, %hash);
    
  3. or download this
    # pass a reference to %hash, which is a scalar
    foo(\%hash);
    ...
    sub foo {
        my $hashref = shift;
    }
    
  4. or download this
    sub foo {
        my $hashref = shift;
    ...
        my $hashref = shift;
        # manipulate data as above
    }