From: Dagfinn Ilmari Mannsåker Date: Tue, 8 Oct 2013 12:02:23 +0000 (+0100) Subject: Use explicit variable on loop X-Git-Tag: v0.08260~129 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=dbsrgits%2FDBIx-Class.git;a=commitdiff_plain;h=49f7b6c7e263293f06a9b308e02e9a26bf94cc20 Use explicit variable on loop --- diff --git a/lib/DBIx/Class/Storage/DBI/SQLite.pm b/lib/DBIx/Class/Storage/DBI/SQLite.pm index 547dae4..9bd51a4 100644 --- a/lib/DBIx/Class/Storage/DBI/SQLite.pm +++ b/lib/DBIx/Class/Storage/DBI/SQLite.pm @@ -264,24 +264,24 @@ sub _dbi_attrs_for_bind { # 0.08191 and 0.08209 inclusive (fixed in 0.08210 and higher) my $stringifiable = 0; - for (0.. $#$bindattrs) { + for my $i (0.. $#$bindattrs) { - $stringifiable++ if ( length ref $bind->[$_][1] and overload::Method($bind->[$_][1], '""') ); + $stringifiable++ if ( length ref $bind->[$i][1] and overload::Method($bind->[$i][1], '""') ); if ( - defined $bindattrs->[$_] + defined $bindattrs->[$i] and - defined $bind->[$_][1] + defined $bind->[$i][1] and - $bindattrs->[$_] eq DBI::SQL_INTEGER() + $bindattrs->[$i] eq DBI::SQL_INTEGER() and - $bind->[$_][1] !~ /^ [\+\-]? [0-9]+ (?: \. 0* )? $/x + $bind->[$i][1] !~ /^ [\+\-]? [0-9]+ (?: \. 0* )? $/x ) { carp_unique( sprintf ( "Non-integer value supplied for column '%s' despite the integer datatype", - $bind->[$_][0]{dbic_colname} || "# $_" + $bind->[$i][0]{dbic_colname} || "# $i" ) ); - undef $bindattrs->[$_]; + undef $bindattrs->[$i]; } }