Skip to content

cv-library/Perl-Format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Perl::Format Travis Coveralls

Rules

last_insert_id

Remove redundant undefs from DBI's last_insert_id, asumes DBI 1.642+.

Before

$dbh->last_insert_id( undef, undef, undef, undef );
$dbh->last_insert_id( (undef) x 4 );
$dbh->last_insert_id( $catalog, $schema, $table, $field );

After

$dbh->last_insert_id;
$dbh->last_insert_id;
$dbh->last_insert_id( $catalog, $schema, $table, $field );

redundant_qr

Replace redundant qr/.../ with m/.../.

Before

my $foo = qr/bar/;
if ( $baz =~ qr/qux/ ) { ... }

After

my $foo = qr/bar/;
if ( $baz =~ /qux/ ) { ... }

redundant_scalar

Remove redundant scalar operators where the expression is already in scalar context.

Before

my $foo = scalar @foo;
if ( scalar @bar ) { ... }
print scalar @baz;

After

my $foo = @foo;
if (@bar) { ... }
print scalar @baz;

slash_regexes

Rewrite regexes to use forward slash as the delimiter and drop the redundant m.

Before

m!foo!;
m/bar/g;
m(baz/qux);

After

/foo/;
/bar/g;
m(baz/qux);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages