package checkStuff; sub new { my $class = shift; my $bar = 2; bless \$bar, $class; return \$bar; # This line is redundant. } 1; package main; use strict; use warnings; my $obj = checkStuff->new(); print $obj, "\n"; print ref $obj, "\n"; __OUTPUT__ checkStuff=SCALAR(0x155ae0c) checkStuff