Subject: | Should use definedness not truth in unpacking arguments |
On a quick skim of your code, one thing jumps out at me.
In sub crypt:
my $data = shift || $_ || '';
This will likely cause problems for any that happens to appear numerically zero, such as
->crypt( "00000000" )
->crypt( "0\nabcde" )
etc...
This should be fixed; ideally with
use 5.010;
...
my $data = shift // $_ // '';
so that it uses definedness instead. Failing that to keep 5.8 compatibility, perhaps an explicit ? : test:
my $data = @_ ? shift :
defined $_ ? $_ :
'';
--
Paul Evans