Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

Re^2: Accessing values of a Hash object

by dReKurCe (Scribe)
on Mar 13, 2007 at 21:21 UTC ( [id://604689]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://604689]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-24 23:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found