TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [TCLUG:14107] Need help with Perl program



Mike Glaser wrote:

> I am trying to learn Perl and I am having trouble solving what I
> would think should be a simple problem.
>
> What I would like to do is create an array that has in it all of the
> files in a directory and its subdirectories. To put it another way, I
> am looking for the output of 'ls -R' placed into an array more or
> less.

a cheap (read cheesy) way out

@out = `find . -print';  # replace . with the name of the directory if
you aren't already in it

you'll probably want to chomp each array line to remove the \n, but I'd
do that while you were doing other processing...

Eric