Package foo; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw( get_match ); sub get_match { my $match_me=shift; # if ($match_me=~/(.+)/){ return $1; } else{ return undef; } } 1;