Re: $File::Find and no_chdir

2007-09-29 Thread Dr.Ruud
schms schreef: opendir DH, $DIR or die Cannot open '$DIR' $!; print map $DIR/$_\n, readdir DH; closedir DH; Looks very 'global variables' oriented to me. Compare to: { opendir my $dh, $dir or die Cannot open '$dir': $!; while (my $e = readdir $dh) { $e =

$File::Find and no_chdir

2007-09-27 Thread schms
Hi, I have a UNIX directory $DIR which contains a lot of files and subdirecotires. Now, I would like to list all files and subdirectories in $DIR only. That means, $File::Find should not go into any subdirectories of $DIR and list the files and subdirectories there as well. So far, I have not

Re: $File::Find and no_chdir

2007-09-27 Thread John W. Krahn
schms wrote: Hi, Hello, I have a UNIX directory $DIR which contains a lot of files and subdirecotires. Now, I would like to list all files and subdirectories in $DIR only. That means, $File::Find should not go into any subdirectories of $DIR and list the files and subdirectories there as

Re: $File::Find and no_chdir

2007-09-27 Thread Paul Lalli
On Sep 27, 6:00 am, [EMAIL PROTECTED] (Schms) wrote: I have a UNIX directory $DIR which contains a lot of files and subdirecotires. Now, I would like to list all files and subdirectories in $DIR only. That means, $File::Find should not go into any subdirectories of $DIR and list the files

Re: $File::Find and no_chdir

2007-09-27 Thread schms
On 27 Sep., 15:01, [EMAIL PROTECTED] (Paul Lalli) wrote: On Sep 27, 6:00 am, [EMAIL PROTECTED] (Schms) wrote: I have a UNIX directory $DIR which contains a lot of files and subdirecotires. Now, I would like to list all files and subdirectories in $DIR only. That means, $File::Find

Re: File::find with no_chdir

2006-09-19 Thread Beginner
On 18 Sep 2006 at 22:34, John W. Krahn wrote: I see. Thanx And this I guess: Ternary ``?:'' is the conditional operator, just as in C. It works much like an if-then-else. If the argument before the ? is true, the argument before the : is returned, otherwise the argument after the : is

Re: File::find with no_chdir

2006-09-19 Thread Emilio Casbas
John W. Krahn wrote: Emilio Casbas wrote: Hi, Hello, I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\wanted, @ARGV); sub wanted { print $File::Find::name\n if(-d); } --- I want to do a directory search for a given ARG

Re: File::find with no_chdir

2006-09-19 Thread Mumia W.
On 09/18/2006 10:11 AM, Emilio Casbas wrote: Hi, I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\wanted, @ARGV); sub wanted { print $File::Find::name\n if(-d); } --- I want to do a directory search for a given ARG, but no a recursive search

File::find with no_chdir

2006-09-18 Thread Emilio Casbas
Hi, I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\wanted, @ARGV); sub wanted { print $File::Find::name\n if(-d); } --- I want to do a directory search for a given ARG, but no a recursive search, for example this script show this; [EMAIL

Re: File::find with no_chdir

2006-09-18 Thread Jack Faley ( Who's going to take me serious without a laser pointer?)
On 9/18/06, Emilio Casbas [EMAIL PROTECTED] wrote: Hi, I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\wanted, @ARGV); sub wanted { print $File::Find::name\n if(-d); } --- I want to do a directory search for a given ARG, but no a recursive

Re: File::find with no_chdir

2006-09-18 Thread D. Bolliger
Emilio Casbas am Montag, 18. September 2006 17:11: Hi, Hi Emilio I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\wanted, @ARGV); sub wanted { print $File::Find::name\n if(-d); } --- I want to do a directory search for a given ARG

Re: File::find with no_chdir

2006-09-18 Thread John W. Krahn
Emilio Casbas wrote: Hi, Hello, I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\wanted, @ARGV); sub wanted { print $File::Find::name\n if(-d); } --- I want to do a directory search for a given ARG, but no a recursive search

Re: File::find with no_chdir

2006-09-18 Thread Beginner
On 18 Sep 2006 at 15:05, John W. Krahn wrote: Emilio Casbas wrote: I have this script; --- use File::Find; $File::Find::no_chdir = 0; find(\wanted, @ARGV); sub wanted { print $File::Find::name\n if(-d); } --- I want to do a directory

Re: File::find with no_chdir

2006-09-18 Thread David Romano
Beginner wrote on Mon, Sep 18, 2006 at 03:24:08PM PDT: On 18 Sep 2006 at 15:05, John W. Krahn wrote: opendir my $dh, $dir or die Cannot open '$dir' $!; print $dir\n, map !/\A\.\.?\z/ -d $dir/$_ ? $dir/$_\n : (), readdir $dh; John That's looks nice John...but what

Re: File::find with no_chdir

2006-09-18 Thread John W. Krahn
Beginner wrote: On 18 Sep 2006 at 15:05, John W. Krahn wrote: my $dir = '/tmp'; opendir my $dh, $dir or die Cannot open '$dir' $!; print $dir\n, map !/\A\.\.?\z/ -d $dir/$_ ? $dir/$_\n : (), readdir $dh; That's looks nice John...but what is actually happening here. Some sort