in reply to Need help with OO perl
($self->{lib}) = ($lib->print_name()); [download]
$self->{lib} = $lib; [download]
Actually, it's the return value of print "From test1","\n"; that's being returned by print_name() (i.e. 1, not undef) — but otherwise your observation is of course correct...