Subject: | Misc Cleanups |
Thanks for this excellent module. I have a few recommendations to bring it up to date a bit :)
If you're interested I can send a patch that does all of these thingsm just let me know :)
1) remove the shebang
2) remove the comments at the top containing revision info, its in the POD and doesn't match
anyway
3) apply some PBP to the code :)
4) Make Clone Optional:
a) remove 'use Clone' line
b) remove all references to $CLONE_SUPPORT
c) change _my_clone() to:
sub _my_clone {
my ( $arg, $depth ) = @_;
if( $clone_behavior ) {
require Clone;
}
if ( !($Clone::VERSION || 0) > 0.09 &&
!UNIVERSAL::isa( $arg, 'HASH' ) &&
!UNIVERSAL::isa( $arg, 'ARRAY' )) {
my $var = $arg; # Forced clone
return $var;
} else {
if ($depth ) {
return Clone::clone( $arg, $depth );
} else {
return Clone::clone( $arg );
}
}
}
5) Exporter/vars stuff doesn't need to be in BEGIN blocks
6) use Exporter ();@ISA = qw(Exporter);
could be done as
use base 'Exporter';
and is a bit safer.