# Create a scalar, an array, a hash: $s='Walt'; @a=(1,2,3); %h=qw(red 20 green 10 blue 15); # Create references (which are always scalars) to each of these: $rs=\$s; $ra=\@a; $rh=\%h; # Print the reference scalars to see what's 'in them': print "The reference variables are: \n"; print "\$rs: $rs \n"; print "\$ra: $ra \n"; print "\$rh: $rh \n"; # Dereference the references (printing the scalar, the second array element, # the whole array, the value of key 'red', and the whole hash): print "$$rs \n"; print "$$ra[1] \n"; print "@$ra \n"; print "$$rh{'red'} \n"; print %$rh, "\n";