Undefined subroutine &main::sub1... #### Foo::sub1 #### use strict; use warnings; package Foo; use base 'Exporter'; BEGIN { our @EXPORT = qw(sub1); } sub sub1 { print "Foo::sub1\n"; } package main; sub sub1 { print "main::sub1\n"; } BEGIN { Foo->import(); } sub1(); main::sub1();