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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
How ro make Directory structure in the perl using the GUI

 



talk2mishal
Novice

Oct 2, 2008, 7:25 PM

Post #1 of 5 (521 views)
How ro make Directory structure in the perl using the GUI Can't Post

Hi,

I m newbei in the perl Technology.
I have to make the application like the Directory Structure in PERL.
so basically i need to make one page which evaluate all directories and display on page (e.g c:/Program Files/ or D:/soware) then it fetch all directories under c:/ProgramFiles show it on page when i click on that directory it shows me all files n folders under it.


Questions I have:-

1)Is it possible in the perl or not?
2)If this application is possible in the perl then how?
3)how to make the gui in the perl?
4)if only perl is not sufficient for this application then should i use the Java with perl for that or not?
5)if i use the java then in that j2SE or j2EE?
6)if i use the Frames of the j2se for the gui then how to call it from the perl?
7)if i use the j2ee then what to use for that (jsp or servlet)?


Please Help me out,I stucked over here.
If u have any links which guide me than pls provide that URLS in the reply.


ann
Novice

Oct 3, 2008, 1:21 AM

Post #2 of 5 (515 views)
Re: [talk2mishal] How ro make Directory structure in the perl using the GUI [In reply to] Can't Post

I think you need the perl/Tk package if you want GUIs, but I've not used it so I could have misunderstood it's purpose.

Getting perl to read directories and list the contents is easy. check out the readdir function.

Do you have to do it in perl? Personally I'd do it in php then use a browser for the GUI.

If you have to use some perl you can write the 'list the content of this directory' in perl then call the perl script from the php, but that would be making it more complex than it needs to be because php can handle the lot.


KevinR
Veteran


Oct 3, 2008, 1:28 AM

Post #3 of 5 (513 views)
Re: [ann] How ro make Directory structure in the perl using the GUI [In reply to] Can't Post

Perl can easily handle this task. There is no need to recommend using PHP. This person has also been advised on another forum to use Tk for the GUI (if its not a CGI program) and File::Find (I think) to list all files and sub directories of a parent directory.
-------------------------------------------------


sycoogtit
User

Oct 3, 2008, 7:20 AM

Post #4 of 5 (508 views)
Re: [ann] How ro make Directory structure in the perl using the GUI [In reply to] Can't Post


Quote
Personally I'd do it in php

*shudders*

--
http://bunsooter.com


maestria
Novice


Oct 4, 2008, 12:52 AM

Post #5 of 5 (486 views)
Re: [sycoogtit] How ro make Directory structure in the perl using the GUI [In reply to] Can't Post

In case you want to search a directory recursively, go ahead and use my code below.
You can use the perl module File::Find.

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 "\n\n==========FILES LISTING========";
foreach(@files){
print;
}
print "\n\n==========DIR LISTING========";
foreach(@dirs){
print;
}

====================================

------------------------------------------------------------------
If some one can do it, we can do it better
http://maestriatech.com
perl@maestriatech.com
--------------------------------------------------------------------

 
 


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

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