opendir mydir/??/??/??

opendir mydir/??/??/??

am 25.11.2007 21:11:06 von avilella

Hi all,

I have a group of dirs and subdirs that look like mydir/00/00/00,
mydir/00/00/01 ... mydir 11/55/99.

In the same way I can do an "ls mydir/??/??/??/*.ext", is there a way
that I can do an opendir like:

opendir(DIR, "mydir/??/??/??")

Cheers,

Albert.

Re: opendir mydir/??/??/??

am 25.11.2007 21:18:17 von Spiros Denaxas

On Nov 25, 8:11 pm, "avile...@gmail.com" wrote:
> Hi all,
>
> I have a group of dirs and subdirs that look like mydir/00/00/00,
> mydir/00/00/01 ... mydir 11/55/99.
>
> In the same way I can do an "ls mydir/??/??/??/*.ext", is there a way
> that I can do an opendir like:
>
> opendir(DIR, "mydir/??/??/??")
>
> Cheers,
>
> Albert.

Hi Albert,

use the File::Find module. I think it will give you the flexibility to
do what you want.

http://search.cpan.org/~nwclark/perl-5.8.8/lib/File/Find.pm

Good luck,
Spiros

Re: opendir mydir/??/??/??

am 26.11.2007 00:21:48 von krahnj

"avilella@gmail.com" wrote:
>
> I have a group of dirs and subdirs that look like mydir/00/00/00,
> mydir/00/00/01 ... mydir 11/55/99.
>
> In the same way I can do an "ls mydir/??/??/??/*.ext", is there a way
> that I can do an opendir like:
>
> opendir(DIR, "mydir/??/??/??")

my @files = glob "mydir/??/??/??/*.ext";

perldoc -f glob
perldoc File::Glob



John
--
use Perl;
program
fulfillment