in reply to Re: Accessing values of a Hash object
in thread Accessing values of a Hash object

Ok, Well I guess what I'm asking is how to get 'at' the hash from the accessor. I want to prompt for the key then print the value.
  • Comment on Re^2: Accessing values of a Hash object

Replies are listed 'Best First'.
Re^3: Accessing values of a Hash object
by GrandFather (Saint) on Mar 13, 2007 at 21:38 UTC

    so you want something like:

    sub access { my ($self, $arg) = @_; return $self->{$arg}; } ... my $arg='B';

    Prints (using previous sample code):

    F a B i o http://wibble.wobble.com

    DWIM is Perl's answer to Gödel