Two points in follow-up:

1. This bug has been difficult to diagnose because Parrot::Distribution -- which is what it is ultimately testing -- names some variables in ways that, IMHO, are misleading. Take, for example, this subroutine:

sub get_perl_language_files {
    my $self = shift;

    my @files = (
        $self->perl_source_files,
    );

    my @perl_language_files = ();
    foreach my $file ( @files ) {
        next if $self->is_perl_exemption($file);
        print STDERR "$file\n";
        push @perl_language_files, $file;
    }

    return @perl_language_files;
}

I would expect that @perl_language_files would contain a list of files. Instead, it contains a list of objects, with the actual filenames buried within the objects' data structures.

$VAR1 = [
          bless( {
                   'NAME' => 'Parrot.pm',
'PARENT_PATH' => '/Users/jimk/work/parrot/lib/Parrot/Docs/Section', 'PATH' => '/Users/jimk/work/parrot/lib/Parrot/Docs/Section/Parrot.pm'
                 }, 'Parrot::Docs::File' ),
          bless( {
                   'NAME' => 'memalign.pm',
                   'PARENT_PATH' => '/Users/jimk/work/parrot/config/auto',
'PATH' => '/Users/jimk/work/parrot/config/auto/memalign.pm'
                 }, 'Parrot::Docs::File' ),
...
];

2. Parrot::Distribution contains a subroutine called is_perl() which presumably tests whether a file in @perl_language_files actually *is* a Perl file.

sub is_perl {
    my $self     = shift;
    my $filename = shift;

    if ( !-f $filename ) {
        return 0;
    }

    # modules and perl scripts should always be tested..
    if ( $filename =~ /\.(?:pm|pl)$/ ) {
        return 1;
    }

    # test files (.t) and configure (.in) files might need testing.
    # ignore everything else.
    if ( $filename !~ /\.(?:t|in)$/ ) {
        return 0;
    }

    # Now let's check to see if there's a perl shebang.

    open my $file_handle, '<', $filename
        or $self->_croak( "Could not open $filename for reading" );
    my $line = <$file_handle>;
    close $file_handle;

    if ( $line && $line =~ /^#!.*perl/ ) {
        return 1;
    }

    return 0;
}

However, I cannot locate any location where is_perl() is called.

[parrot] 542 $ grep -n is_perl lib/Parrot/Distribution.pm
388:        next if $self->is_perl_exemption($file);
390:#        next unless $self->is_perl($file);
398:=item C<is_perl_exemption()>
409:    sub is_perl_exemption {
425:=item C<is_perl()>
433:sub is_perl {

kid51

Reply via email to