in reply to Header file management
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Header file management
by QM (Parson) on Apr 30, 2018 at 13:21 UTC | |
by shmem (Chancellor) on Apr 30, 2018 at 14:21 UTC | |
|
Re^2: Header file management
by smaines (Novice) on Apr 30, 2018 at 16:00 UTC | |
|
Re^2: Header file management
by smaines (Novice) on Apr 30, 2018 at 15:36 UTC |