# ---- # Main Code require 'mylib.pl'; # [ 1 ] #use MyModule; # [ 2 ] #use MyModule qw(:All); # [ 3 ] printf("timestamp: %s\n", mylib::timestamp(time)); # [ 1 ] #printf("timestamp: %s\n", MyModule::timestamp(time)); # [ 2 ] #printf("timestamp: %s\n", timestamp(time)); # [ 3 ] # ---- # mylib.pl package mylib; #use Time::Local; sub func1 { return reverse @_ } sub func2 { return map{ uc }@_ } sub timestamp { my ($timer) = @_; my ($ret); $ret = localtime($timer); } # End of timestamp 1; # ---- # MyModule.pm package MyModule; use strict; use Exporter; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = 1.00; @ISA = qw(Exporter); @EXPORT = (); @EXPORT_OK = qw(func1 func2 timestamp); %EXPORT_TAGS = ( DEFAULT => [qw(&func1)], Both => [qw(&func1 &func2)], All => [qw(&func1 &func2 ×tamp)]); sub func1 { return reverse @_ } sub func2 { return map{ uc }@_ } sub timestamp { my ($timer) = @_; my ($ret); $ret = localtime($timer); } # End of timestamp 1;