#!/usr/bin/perl # File: demo.pl use strict; use warnings; $|=1; # turn off buffering use Demo qw(example); # test() is not exported by Demo.pl # this the error produced... # Undefined subroutine &main::test called at C:\Projects_Perl\testing\demo.pl line 7. # my $x = test(); my $y = Demo::test(); #this is ok , Fully qualified name print "test() returned $y\n"; __END__ Prints: top level in Demo.pm this is the test subroutine! test() returned 1