#!/usr/bin/perl
sub getInfo ($\%) {
my $scalar = shift;
my $hash = shift;
print "scalar = '$scalar'\n";
print "hash = $hash\n";
print "$_ => $hash->{$_}\n" for keys %$hash;
}
my %hash = (foo => 'bar', baz => 'quux');
my $scalar = 'string';
getInfo($scalar,%hash);
__END__
####
getInfo($scalar,%hash);
####
my ( $thescalar, %thehash ) = @_;
####
sub getInfo {
my ( $thescalar, $thehashref ) = @_;
....
}
getInfo( $scalar, \%hash );
####
sub getInfo {
my ( $thescalar, %thehash ) = @_;
....
}
getInfo( $scalar, %hash );