Re: Need a list of files in a dir.

2005-09-27 Thread bright true
Hello , in your examples you're opening files not dir's , to open a directory use this instead opendir(DIR,$dirname) or die $!; my @content = readdir(DIR); closedir(DIR); then to read files inside it , for (@content){ print ; } that's it , if you need to remove (. and ..) which means the top

Re: Need a list of files in a dir.

2005-09-26 Thread Tom Allison
Wiggins d'Anconia wrote: Please bottom post... Daniel Kurtz wrote: Ooh ooh ooh! One I know! open(COMMAND, dir |); @files = COMMAND; Well, there's two methods that I use where I can and they are probably more portable. glob works well most of the time: @files = /directory/goes/here/*;

Re: Need a list of files in a dir.

2005-08-27 Thread Randal L. Schwartz
Ryan == Ryan Frantz [EMAIL PROTECTED] writes: Ryan I don't think that Randal was arguing that there are more UNIX vs. Ryan Windows systems as much as he was stating that given a number of UNIX Ryan systems vs. Windows systems, more UNIX systems have Perl Ryan implementations. I *was* saying

RE: Need a list of files in a dir.

2005-08-26 Thread Daniel Kurtz
Ooh ooh ooh! One I know! open(COMMAND, dir |); @files = COMMAND; Daniel -Original Message- From: Luinrandir [mailto:[EMAIL PROTECTED] Sent: Thursday, August 25, 2005 21:33 To: beginners@perl.org Subject: Need a list of files in a dir. How do I get the list of files in a DIR and put

Re: Need a list of files in a dir.

2005-08-26 Thread Wiggins d'Anconia
Please bottom post... Daniel Kurtz wrote: Ooh ooh ooh! One I know! open(COMMAND, dir |); @files = COMMAND; Sort of, while that *may* work it doesn't have proper error checking, is less secure, less efficient, and less portable than many other ways, especially those already provided. This

RE: Need a list of files in a dir.

2005-08-26 Thread Ryan Frantz
-Original Message- From: Wiggins d'Anconia [mailto:[EMAIL PROTECTED] Sent: Friday, August 26, 2005 11:27 AM To: Daniel Kurtz Cc: beginners@perl.org Subject: Re: Need a list of files in a dir. Please bottom post... Daniel Kurtz wrote: Ooh ooh ooh! One I know!

RE: Need a list of files in a dir.

2005-08-26 Thread Ryan Frantz
-Original Message- From: Luinrandir [mailto:[EMAIL PROTECTED] Sent: Friday, August 26, 2005 2:53 PM To: Daniel Kurtz Cc: beginners@perl.org Subject: Re: Need a list of files in a dir. Thanks Daniel.. and keep on TOP POSTING! Not to start a flame war, but it has been

Re: Need a list of files in a dir.

2005-08-26 Thread Luinrandir
Thanks Daniel.. and keep on TOP POSTING! Gawd I hate bottom posting! Lou Hernsen (.. and so my children the war between the topposters and bottomposters began The topposters, light happy and joyous beings ; the bottomposters, smelly and scragly and living below the earth in tunnels and caves in

Re: Need a list of files in a dir.

2005-08-26 Thread Bob Showalter
Daniel Kurtz wrote: Ooh ooh ooh! One I know! open(COMMAND, dir |); @files = COMMAND; Please tell me you're kidding. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

RE: Need a list of files in a dir.

2005-08-26 Thread Chance Ervin
-Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Friday, August 26, 2005 9:40 AM To: Daniel Kurtz; beginners@perl.org Subject: Re: Need a list of files in a dir. Daniel Kurtz wrote: Ooh ooh ooh! One I know! open(COMMAND, dir |); @files = COMMAND; Please tell

RE: Need a list of files in a dir.

2005-08-26 Thread Daniel Kurtz
Bob Showalter wrote: Please tell me you're kidding. Why? It works. The question asked how you can do it, not the BEST way to do it. And after a week of Perling, this was the one way I knew. Now I know two ways. g daniel -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

Re: Need a list of files in a dir.

2005-08-26 Thread Randal L. Schwartz
Daniel == Daniel Kurtz [EMAIL PROTECTED] writes: Daniel Why? It works. Not on Unix it doesn't. And there are far more Unix installations of Perl than Windows installations of Perl. -- Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095 merlyn@stonehenge.com

RE: Need a list of files in a dir.

2005-08-26 Thread Daniel Kurtz
From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] Daniel Why? It works. Not on Unix it doesn't. And there are far more Unix installations of Perl than Windows installations of Perl. Good point. Although... while I'm certain that a higher PERCENTAGE of Unix systems have Perl than Windows

RE: Need a list of files in a dir.

2005-08-26 Thread Ryan Frantz
-Original Message- From: Daniel Kurtz [mailto:[EMAIL PROTECTED] Sent: Friday, August 26, 2005 3:49 PM To: beginners@perl.org Subject: RE: Need a list of files in a dir. From: Randal L. Schwartz [mailto:[EMAIL PROTECTED] Daniel Why? It works. Not on Unix it doesn't. And there

Re: Need a list of files in a dir.

2005-08-26 Thread Bob Showalter
Daniel Kurtz wrote: Bob Showalter wrote: Please tell me you're kidding. Why? It works. The question asked how you can do it, not the BEST way to do it. And after a week of Perling, this was the one way I knew. Now I know two ways. g OK, you weren't kidding. Since you're new to Perl, you

RE: Need a list of files in a dir.

2005-08-26 Thread Daniel Kurtz
From: Bob Showalter [mailto:[EMAIL PROTECTED] OK, you weren't kidding. Since you're new to Perl, you get a free pass :~) I appreciate the indulgence g. Seriously, though, not all of us run Perl on Windows. Your approach is Windows-specific. True, I hadn't thought of that. I'm primarily a

Need a list of files in a dir.

2005-08-25 Thread Luinrandir
How do I get the list of files in a DIR and put in an array? I'm drawing a blank on my search for this. thanks Lou -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/ http://learn.perl.org/first-response

Re: Need a list of files in a dir.

2005-08-25 Thread Chris Devers
On Thu, 25 Aug 2005, Luinrandir wrote: How do I get the list of files in a DIR and put in an array? I'm drawing a blank on my search for this. Try writing a program instead, that seems to work better than drawing. Some people use globs in their programs for this. What did you try? --

Re: Need a list of files in a dir.

2005-08-25 Thread John W. Krahn
Luinrandir wrote: How do I get the list of files in a DIR and put in an array? perldoc -f opendir perldoc -f readdir perldoc -f glob John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: Need a list of files in a dir.

2005-08-25 Thread Luinrandir
Thanks.. I'll look it over Lou - Original Message - From: John W. Krahn [EMAIL PROTECTED] To: Perl Beginners beginners@perl.org Sent: Thursday, August 25, 2005 6:26 PM Subject: Re: Need a list of files in a dir. Luinrandir wrote: How do I get the list of files in a DIR and put in an

Re: Need a list of files in a dir.

2005-08-25 Thread Ezra Taylor
Your a funny dude Chris. On 8/25/05, Chris Devers [EMAIL PROTECTED] wrote: On Thu, 25 Aug 2005, Luinrandir wrote: How do I get the list of files in a DIR and put in an array? I'm drawing a blank on my search for this. Try writing a program instead, that seems to work better than