#!/usr/bin/perl use strict; use warnings; sub mysub (\@) { my $arg = $_; print ref $arg."\n"; } my (@array, %hash, $scalar); mysub (\@array); mysub (\%hash); mysub (\$scalar); mysub (@array); # This is the only one which compiles mysub (%hash); mysub ($scalar); mysub (qw(This is a list)); #### Type of arg 1 to main::mysub must be array (not reference constructor) at C:\gash.pl line 15, near "@array)" Type of arg 1 to main::mysub must be array (not reference constructor) at C:\gash.pl line 16, near "%hash)" Type of arg 1 to main::mysub must be array (not single ref constructor) at C:\gash.pl line 17, near "$scalar)" Type of arg 1 to main::mysub must be array (not private hash) at C:\gash.pl line 20, near "%hash)" Type of arg 1 to main::mysub must be array (not private variable) at C:\gash.pl line 21, near "$scalar)" Type of arg 1 to main::mysub must be array (not list) at C:\gash.pl line 23, near "qw(This is a list))" Execution of C:\gash.pl aborted due to compilation errors.