You're right. Is this better?
#!perl use strict; use warnings; package MyPkg; sub new { my ($self, $name) = @_; my %hash = ( name => $name ); return bless \%hash; } sub print { my $self = shift; print "name: " . $self->{name}; } package main; my $obj = MyPkg->new('foo'); $obj->print();
In reply to Re^3: hash reference to itself
by VinsWorldcom
in thread hash reference to itself
by ExReg
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |