#!/usr/bin/perl use IT; it = IT->new(); it->a(); it->b(); |
package IT; sub new { my($class) = shift; bless { $x => 0 }, $class; } sub a { my($self) = shift; $y = 12; $self->{"x"} = 17; } sub b { my($self) = shift; print $self->{"x"} . " = $y\n"; } |