#!/usr/bin/perl use warnings; use strict; #use MyTest; # Imports what's in the module's @EXPORT #use MyTest ( ); # Won't work. #use MyTest qw( ); # Another way of writing the same thing. use MyTest qw( testroutine ); # Imports testroutine and nothing else. my $output = testroutine(); print $output, "\n"; #### # MyTest.pm use strict; use warnings; package MyTest; BEGIN { our @EXPORT = qw( ); # Export nothing by default. our @EXPORT_OK = qw( testroutine ); require Exporter; *import = \&Exporter::import; } # Put other "use" statements here, if any. sub testroutine { return "This is a test"; } 1;