Skip Menu |

This queue is for tickets about the DBIx-Class-Schema-Loader CPAN distribution.

Report information
The Basics
Id: 96010
Status: resolved
Priority: 0/
Queue: DBIx-Class-Schema-Loader

People
Owner: Nobody in particular
Requestors: domm [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.07039
Fixed in: 0.07040



Subject: $_ should be localized or not used
In DBIx::Class::Schema::Loader::Base->_parse_generated_file (around line 2211) you do while(<$fh>) { ... } If somewhere in the scope that's calling make_schema_at $_ is already set, this causes the following error: Modification of a read-only value attempted at local/lib/perl5/DBIx/Class/Schema/Loader/Base.pm line 2211. The error is of course easy to avoid by NOT clobbering $_, but as you can never be sure what some crazy users of your code will do, it's probably better to either localize $_, or to use an explicit variable So please either add local $_ to _parse_generated_file, probably after the line my ($md5, $ts, $ver, $gen); or do something like while(my $line = <$fh>) { ... If you have a preference over one or the other, I'm happy to come up with a patch (but I guess it's rather trivial to just fix it..) BTW, you can read more about my problem here: domm.plix.at/perl/2014_05_modification_of_readonly_value.html
Thanks for the report. This has been fixed (by localising $_ before the loop) in 0.07040, now available on CPAN.