#!/usr/bin/perl use warnings; use strict; my $a = new Foo; $a->hello; package Foo; sub new { return bless {},shift; } sub hello { print "hello"; } #### hello #### #!/usr/bin/perl use warnings; use strict; sub new { print "haha"; return; } my $a = new Foo; $a->hello; package Foo; sub new { return bless {},shift; } sub hello { print "hello"; } #### Bareword "Foo" not allowed while "strict subs" in use at test.pl line 10. Execution of test.pl aborted due to compilation errors.