in reply to Need help with File::Find

find( sub { push(@datein, $File::Find::name) if /\.($ext)$/i; }, $base );

Replies are listed 'Best First'.
Re: Re: Need help with File::Find
by ppm (Novice) on Feb 26, 2003 at 15:44 UTC
    Oh .. thx! I exclude in this code also all non ASCII Files:
    use File::Find; my $base = "c:/blub"; my $ext = "html|js"; find( sub { push(@dateien, $File::Find::name) if ( /\.($ext)$/i && -T); }, $base );
    Now i will also exclude some directories defined in a var
    my dirs = "cgi-bin|logs";
    Or bette a hash or array for this? For the dirs i will have a "or" and if this value are empty it should be ignored. Same for the extensions ..

    Thx again (sorry, i'm new to perl)

    ppm