use strict; use warnings; { # This works my $l2 = new T; my $l1 = new P; exit 0; } { package P; sub new { my $self = {}; bless $self,shift; # This call works my $t1 = new T; return $self; } sub s1 { # This call complains that # Bareword "T" not allowed # while "strict subs" in use my $t1 = new T; } } sub s2 { # Even this works my $t1 = new T; } { package T; sub new { return bless {},shift; } }