CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Fun With Perl: Perl Quizzes - Learn Perl the Fun Way:
Directory Structure in perl



Oct 2, 2008, 7:31 PM

Post #1 of 3 (45776 views)
Directory Structure in perl Can't Post

I m newbie in the perl.
I have to implement the Directory structure in the perl.(i.e. Folder and that folder having the other files which are opened in the folde click event .just like our Winndows OS folder Structure like c and D drive.)

how to go ahead?
Pls provide some code or any links.


Oct 4, 2008, 2:55 AM

Post #2 of 3 (45749 views)
Re: [talk2mishal] Directory Structure in perl [In reply to] Can't Post

I can help you with a script that would extract the files and folders recursively from a directory.
You can use this and achieve your result

#!/usr/bin/perl -l
use File::Find;

$start_dir = shift || '.';

find( sub{
-f $_ and push @files, $File::Find::name;
-d $_ and push @dirs, $File::Find::name;
}, $start_dir );
print "@files";
print "@dirs";

If some one can do it, we can do it better


Oct 5, 2008, 10:23 AM

Post #3 of 3 (45672 views)
Re: [maestria] Directory Structure in perl [In reply to] Can't Post

Thanks a lot for such a valuable reply which helps me a lot for my initiation part of my task and increased a confidence to go ahead by using the Positive Thinking..


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives