#!/usr/bin/perl -wT use strict; # hash key lookup using the actual hash (no reference) my %foo = (bar => 'data'); my $val = $foo{bar}; # fetch the scalar key (hence the '$' infront of foo) from the hash print "Val => $val\n"; # hash key lookup using a referent to the hash (hard reference) my %hash = (bar => 'data2'); my $foo = \%hash; my $val2 = $foo->{bar}; # can also be written '$$foo{bar}'; print "Val2 => $val2\n"; # using symbolic (soft) references use vars qw($foo $bar); $bar = 'data3'; $foo = 'bar'; my $val3; { no strict 'refs'; # 'use strict' won't allow this $val3 = $$foo; # find the data by treating the value of $foo as a var name } print "Val3 => $val3\n"; =output Val => data Val2 => data2 Val3 => data3