Front page | perl.cvs.parrot |
Postings from January 2009
[svn:parrot] r34922 - in trunk/lib/Parrot: . IO
From:
petdance
Date:
January 4, 2009 07:49
Subject:
[svn:parrot] r34922 - in trunk/lib/Parrot: . IO
Message ID:
20090104154916.B5A14CB9F9@x12.develooper.com
Author: petdance
Date: Sun Jan 4 07:49:15 2009
New Revision: 34922
Modified:
trunk/lib/Parrot/Distribution.pm
trunk/lib/Parrot/IO/Directory.pm
trunk/lib/Parrot/Vtable.pm
Log:
fix some problems Perl::Critic found
Modified: trunk/lib/Parrot/Distribution.pm
==============================================================================
--- trunk/lib/Parrot/Distribution.pm (original)
+++ trunk/lib/Parrot/Distribution.pm Sun Jan 4 07:49:15 2009
@@ -234,10 +234,11 @@
# Filter out ignored directories
# and return the results
- return sort
+ my @dirs = sort
map { $self->directory_with_name($_) }
grep { !m|(?:$filter_dir)| }
keys %dirs;
+ return @dirs;
};
*{ $method . '_file_with_name' } = sub {
@@ -272,9 +273,11 @@
# Look through the list of distribution files
# for files ending in the proper extension(s)
# and return a sorted list of filenames
- return sort
+ my @files = sort
map { $self->file_with_name($_) }
- grep { m|(?i)(?:$filter_ext)| } $self->_dist_files;
+ grep { m|(?i)(?:$filter_ext)| }
+ $self->_dist_files;
+ return @files;
};
}
}
Modified: trunk/lib/Parrot/IO/Directory.pm
==============================================================================
--- trunk/lib/Parrot/IO/Directory.pm (original)
+++ trunk/lib/Parrot/IO/Directory.pm Sun Jan 4 07:49:15 2009
@@ -189,7 +189,9 @@
my $dh = DirHandle->new( $self->path )
or die "can't opendir $self->{PATH}: $!";
- return sort grep { $_ ne '.' and $_ ne '..' } $dh->read();
+ my @files = sort grep { $_ ne '.' and $_ ne '..' } $dh->read();
+
+ return @files;
}
=item C<file_and_directory_paths()>
@@ -213,7 +215,9 @@
sub file_paths {
my $self = shift;
- return sort grep { -f } $self->file_and_directory_paths;
+ my @paths = sort grep { -f } $self->file_and_directory_paths;
+
+ return @paths;
}
=item C<directory_paths()>
@@ -225,7 +229,9 @@
sub directory_paths {
my $self = shift;
- return sort grep { -d } $self->file_and_directory_paths;
+ my @paths = sort grep { -d } $self->file_and_directory_paths;
+
+ return @paths;
}
=item C<file_exists_with_name($name)>
@@ -324,7 +330,9 @@
$suffixes{ $file->suffix } = 1;
}
- return sort keys %suffixes;
+ my @suffixes = sort keys %suffixes;
+
+ return @suffixes;
}
=item C<files_with_suffix($suffix, $recursive, $ignore)>
Modified: trunk/lib/Parrot/Vtable.pm
==============================================================================
--- trunk/lib/Parrot/Vtable.pm (original)
+++ trunk/lib/Parrot/Vtable.pm Sun Jan 4 07:49:15 2009
@@ -130,9 +130,8 @@
my $vtable = shift;
my $defs = q{};
- my $entry;
- for $entry ( @{$vtable} ) {
+ for my $entry ( @{$vtable} ) {
next if ( $entry->[4] =~ /MMD_/ );
my $args = join( ", ", 'PARROT_INTERP', 'PMC* pmc', split( /\s*,\s*/, $entry->[2] ) );
$defs .= "typedef $entry->[0] (*$entry->[1]_method_t)($args);\n";
@@ -152,9 +151,8 @@
my $vtable = shift;
my $struct = q{};
- my $entry;
- $struct = <<"EOF";
+ $struct = <<'EOF';
typedef enum {
VTABLE_IS_CONST_FLAG = 0x001,
VTABLE_HAS_CONST_TOO = 0x002,
@@ -182,7 +180,7 @@
/* Vtable Functions */
EOF
- for $entry ( @{$vtable} ) {
+ for my $entry ( @{$vtable} ) {
next if ( $entry->[4] =~ /MMD_/ );
$struct .= " $entry->[1]_method_t $entry->[1];\n";
}
-
[svn:parrot] r34922 - in trunk/lib/Parrot: . IO
by petdance