package Foo; use strict; use warnings; sub new { return bless {}; } sub method { return "The value returned by method"; } return 1; #### #!/usr/bin/perl use strict; use warnings; use Foo; my $object = Foo->new(); print $object->method();