#!/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__ #### scalar = 'string' hash = HASH(0x81677a4) baz => quux foo => bar #### my @array = qw(foo bar baz); getInfo($scalar, @array); Type of arg 2 to main::getInfo must be hash (not private array) at foo.pl line 16, near "@array)"