in reply to Files within specified directory

Hi !!

Sorry, If am late on this ! Hope this mite help u .

use strict; use warnings; use File::Find::Rule; my $path = '/home/vishi83'; my $rule = File::Find::Rule->new; $rule->file; $rule->name('*.txt'); my @filez = $rule->in($path);
untested : ( am using Unix machine ) Think You will get all the files within the sub-directories too..

Am sure , this is pretty clear, $path holds ur pathname (c:/directory).. Also read perldoc of File::Find::Rule . It has got plenty of options , so we can do such things with ease.

Thank u !!

A perl Script without 'strict' is like a House without Roof; Both are not Safe;

Replies are listed 'Best First'.
Re^2: Files within specified directory
by mosh (Scribe) on Dec 12, 2005 at 08:51 UTC
    Thanks a lot guys !!!