Subject: | postincrement |
Hi there!
I've been using your module for a very long time and it has never caused us any problems. However, recently we've been trying to update our perl installation. Upon doing so, we experienced a warning with your distribution:
Argument "__Positional_0001" isn't numeric in postincrement (++) at /usr/local/lib/perl5/site_perl/5.24.0/Class/Std/Storable.pm line 51.
This warning seemed to have started from version perl 5.22. I couldn't pinpoint the exact change in perl which caused this warning; however, I also noticed that the backup value "__Positional_0001" was never incremented properly either. According to http://perldoc.perl.org/perlop.html#Auto-increment-and-Auto-decrement, it seems the problem is the "_" in the string, such that it's unable to be cast in numeric context.
I'm not sure your reasoning for the underscores but I propose simply removing them. Please see my attached diff.
For your convenience, I've also attached a re-packaged distribution file with the patch, version number bumps, and updated Changes file.
Thanks for looking into this!
Subject: | Class-Std-Storable-0.0.2.tar.gz |
Message body not shown because it is not plain text.
Subject: | Class-Std-Storable-v0.0.1-fix-perl-5.22-numeric-increment-warning.diff |
diff -Naur a/lib/Class/Std/Storable.pm b/lib/Class/Std/Storable.pm
--- a/lib/Class/Std/Storable.pm 2005-08-25 03:43:33.000000000 +0000
+++ b/lib/Class/Std/Storable.pm 2016-10-19 00:38:13.232656642 +0000
@@ -41,7 +41,7 @@
next if $attr !~ m/\A ATTRS? \s* (?:[(] (.*) [)] )? \z/xms;
my $name;
#we have a backup if no name is given for the attribute.
- $positional_arg_of{$package} ||= "__Positional_0001";
+ $positional_arg_of{$package} ||= "Positional0001";
#but we would prefer to know the argument as the class does.
if (my $config = $1) {
$name = Class::Std::_extract_init_arg($config)