Algorithm-Dependency
view release on metacpan or search on metacpan
lib/Algorithm/Dependency/Source/File.pm view on Meta::CPAN
close( FILE ) or return undef;
# Split, trim, clean and remove comments
my @content = grep { ! /^\s*(?:\#|$)/ }
split /\s*[\015\012][\s\015\012]*/, $source;
# Parse and build the item list
my @Items = ();
foreach my $line ( @content ) {
# Split the line by non-word characters
my @sections = grep { length $_ } split /\W+/, $line;
return undef unless scalar @sections;
# Create the new item
my $Item = Algorithm::Dependency::Item->new( @sections ) or return undef;
push @Items, $Item;
}
\@Items;
}
t/00-report-prereqs.t view on Meta::CPAN
if ( $DO_VERIFY_PREREQS && $type eq 'requires' ) {
push @dep_errors, "$mod is not installed ($req_string)";
}
}
}
if ( @reports ) {
push @full_reports, "=== $title ===\n\n";
my $ml = _max( map { length $_->[0] } @reports );
my $wl = _max( map { length $_->[1] } @reports );
my $hl = _max( map { length $_->[2] } @reports );
if ($type eq 'modules') {
splice @reports, 1, 0, ["-" x $ml, "", "-" x $hl];
push @full_reports, map { sprintf(" %*s %*s\n", -$ml, $_->[0], $hl, $_->[2]) } @reports;
}
else {
splice @reports, 1, 0, ["-" x $ml, "-" x $wl, "-" x $hl];
push @full_reports, map { sprintf(" %*s %*s %*s\n", -$ml, $_->[0], $wl, $_->[1], $hl, $_->[2]) } @reports;
}
( run in 0.645 second using v1.01-cache-2.11-cpan-65fba6d93b7 )