http://www.perlmonks.org?node_id=1203421


in reply to Perl archeology: Need help in refactoring of old Perl code that does not use strict

Hi,

Since no one has addressed this part...

How can I access subs a,b,c without qualifying them with namespace x from the main:: namespace?

See Exporter or Exporter::Tiny. Also see perlmod.

"main" script:

use strict; use warnings; use Foo qw/ bar /; print bar('baz'); __END__

file 'Foo.pm':
package Foo; use strict; use warnings; use parent qw/ Exporter /; our @EXPORT_OK = qw/ bar /; sub bar { return uc shift } 1;

Hope this helps!


The way forward always starts with a minimal test.