#!/usr/bin/perl -w package Testing; sub new { my $class = shift; my $ref = shift; my $self = \$ref; bless $self, $class; } sub get { my $self = shift; ${$self}->{shift()}; } package main; my %h = (one => 1, two => 2); my $t = Testing->new(\%h); print $t->get($_)."\n" for qw(one two);