Remove redundant undefs from DBI's last_insert_id, asumes DBI 1.642+.
$dbh->last_insert_id( undef, undef, undef, undef );
$dbh->last_insert_id( (undef) x 4 );
$dbh->last_insert_id( $catalog, $schema, $table, $field );
$dbh->last_insert_id;
$dbh->last_insert_id;
$dbh->last_insert_id( $catalog, $schema, $table, $field );
Replace redundant qr/.../
with m/.../
.
my $foo = qr/bar/;
if ( $baz =~ qr/qux/ ) { ... }
my $foo = qr/bar/;
if ( $baz =~ /qux/ ) { ... }
Remove redundant scalar operators where the expression is already in scalar context.
my $foo = scalar @foo;
if ( scalar @bar ) { ... }
print scalar @baz;
my $foo = @foo;
if (@bar) { ... }
print scalar @baz;
Rewrite regexes to use forward slash as the delimiter and drop the redundant m
.
m!foo!;
m/bar/g;
m(baz/qux);
/foo/;
/bar/g;
m(baz/qux);