For Programmers: Free Programming Magazines  


Home > Archive > PERL Beginners > November 2007 > Script to read the contents of a directory









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Script to read the contents of a directory
John Jack

2007-11-26, 10:02 pm

Hi

I very new to programming and I'm introduced to perl a couple of ws ago.
I want to write a perl script to read a content of a directory and the
subdirectories within and print out the path to all files in this directory
and sub-directories. Can someone help me to do this, please?

I urgently need assistance as this is my first exercise that I'd like to do.

Kind regards,

John Jack

John W . Krahn

2007-11-26, 10:02 pm

On Monday 26 November 2007 14:53, John Jack wrote:
> Hi


Hello,

> I very new to programming and I'm introduced to perl a couple of
> ws ago. I want to write a perl script to read a content of a
> directory and the subdirectories


perldoc File::Find

> within and print out


perldoc -f print

> the path to all files


perldoc -f -f

> in this directory and sub-directories. Can someone help me to
> do this, please?




John
--
use Perl;
program
fulfillment
Gunnar Hjalmarsson

2007-11-27, 4:01 am

John Jack wrote:
> I urgently need assistance as this is my first exercise that I'd like
> to do.


I must be missing something here.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Dr.Ruud

2007-11-27, 4:01 am

John Jack schreef:

> I very new to programming and I'm introduced to perl a couple of
> ws ago. I want to write a perl script to read a content of a
> directory and the subdirectories within and print out the path to all
> files in this directory and sub-directories. Can someone help me to
> do this, please?
>
> I urgently need assistance as this is my first exercise that I'd like
> to do.


perl -MIO::All -wle'
my $io = io ".";
print for $io->All;
'

--
Affijn, Ruud

"Gewoon is een tijger."
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com