in reply to Re: Re: How to list all the installed perl modules
in thread How to list all the installed perl modules

Yeah, I realized that shortly thereafter. I've been picking my brain trying to figure out a way to do this with native functions, but I can't scale the recursion. Anyone else have any ideas? I've tried checking the input for (-d) and pushing it back to @INC, but my "while" doesn't seem to honor this attempt...
perl -e 'while (<@INC>) { while (<$_/**>) { if (-d) { push(@INC,$_) } +elsif (/\.pm/) { print "$_\n" } else { next } } }'

-fuzzyping

Replies are listed 'Best First'.
Re: Re: Re: Re: How to list all the installed perl modules
by lestrrat (Deacon) on Mar 18, 2002 at 01:25 UTC

    how about

    perl -e 'sub f{$d=pop;/\.pm/&&-f$_&&print"$_\n";-d$_&&f($_)for(<$d/*>) +}f($_)for@INC'
Re4: How to list all the installed perl modules
by blakem (Monsignor) on Mar 18, 2002 at 01:47 UTC
    while(<@INC>)
    Is very suspect code.... You probably want something like:
    my @copy = @INC; while(defined($_ = shift(@copy))) { # push to @copy as necessary }
    See Why is @array so slow? for more details.

    -Blake