There are many ways to to that.
Study Modern::Perl by chromatic for a nice way to import modules as a bundle into your current namespace.
If you use 5.18, then the use feature qw(state say) is redundant afaik.
You could also write a file, say, header.pl containing use statements,and write your MyCommonUses.pm as
package MyCommonUses; use strict; use warnings; my $header = '/path/to/header.pl'; my $content = do {local $/; open my $fh,'<',$header or die; <$fh> } or die "couldn't load common use statements, aborted"; sub import { my $caller = caller; eval "package $caller; $content;"; strict->import; warnings->import; } 1;
so you have to edit only the common header file to add or remove packages.
A bonus would be some way to dispense with the inelegant one-semicolon.
Easy. Skip 1;, write
"sigh."
at the end.
In reply to Re: Header file management
by shmem
in thread Header file management
by smaines
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |