In the following case, why is it that I'm able to 'use' the module, yet am unable to call its exported function in the 'main' namespace? I know how to work around this, but I'm trying to understand why this doesn't work the way it is.
[test]$ cat test.pl #!/usr/bin/perl -w use strict; use dir::mod; hello("world"); [test]$ cat dir/mod.pm package mod; use strict; use warnings; use Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(hello); sub hello { print "hello " . shift() . "\n"; } 1; [test]$ ./test.pl Undefined subroutine &main::hello called at ./test.pl line 7. [test]$
Thanks!
In reply to Unable to use exported routine by blakesto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |