in reply to Re: File::FInd subfolders
in thread File::FInd subfolders

sorry, do u mean that it should read $_File....etc?

Replies are listed 'Best First'.
Re: Re: Re: File::FInd subfolders
by Jenda (Abbot) on May 24, 2004 at 18:49 UTC

    No. What I mean is that instead of $File::Find::name you should use $_:

    my $folder = '//..'; find (\&process, $folder); sub process { if ( $_ =~ /\learn$/ ) { open (FILE, '<', $_ ) or die "Cannot open file: $!"; while ( $line = <FILE> ) { $/= "# input for"; $line =~ s/.....; push(@outLines, $line ); } print to outputfile... } }

    Jenda
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
       -- Rick Osborne

    Edit by castaway: Closed small tag in signature