#!/usr/bin/perl use strict; # Great start! my @sample=qw(a,b,c); # Declare array variable &trial(\@sample); # Pass array as a reference to sub sub trial { @sample=@_; # Clobber the contents of your original array # setting the original array to the contents # of the special array (@_), which just has # a reference print join("\t",@$sample); # Try to dereference a scalar variable named # 'sample', which you never declared. } #### #!/usr/bin/perl use strict; use warnings; my @sample = qw(a b c); trial(\@sample); sub trial { my ($aref) = @_; print join "\t", @{ $aref }; }