# this is the file Foo.pm package Foo; use strict; use warnings; sub new { my $class = shift @_; print "class = $class\n"; my $self = {}; return bless $self, $class; } 1; # heres a test program using it, called foo_test.pl # #!/usr/bin/perl use strict; use warnings; use Foo; use Data::Dumper; { print "Arrow test:\n"; my $regular_foo = Foo->new(); print Dumper($regular_foo); print "\n\nColon test:\n"; my $colon_foo = Foo::new(); print Dumper($colon_foo); }