RE: readdir() question

2009-05-28 Thread Ajay Kumar
Sent: Monday, May 25, 2009 4:30 AM To: beginners@perl.org Subject: Re: readdir() question On Mon May 25 2009 @ 4:34, sanket vaidya wrote: > Hi all, > > > > Kindly look at the code below: > > > > use warnings; > > use strict; > > opendir(DIR, "D:\

Re: readdir() question

2009-05-25 Thread Telemachus
On Mon May 25 2009 @ 4:34, sanket vaidya wrote: > Hi all, > > > > Kindly look at the code below: > > > > use warnings; > > use strict; > > opendir(DIR, "D:\\test") || die "can't opendir: $!"; > > my @dots = readdir(DIR); > > print map{"$_.\n"}...@dots; > > > > .. > > ... > > Tes

readdir() question

2009-05-25 Thread sanket vaidya
Hi all, Kindly look at the code below: use warnings; use strict; opendir(DIR, "D:\\test") || die "can't opendir: $!"; my @dots = readdir(DIR); print map{"$_.\n"}...@dots; .. ... Test1 Test2 Test3 Where Test1, Test2, Test3 are files within test directory. Apart from that

Re: readdir question

2005-09-30 Thread Jay Savage
On 9/30/05, Gergely Buday <[EMAIL PROTECTED]> wrote: > Hi, > > this is a working code snippet: > > opendir (DIR, $dir) || die "Open failed: $!\n"; > > $\ = "\n"; > while ($_ = readdir(DIR)) { print; }; > > But when I try to use > > while (readdir(DIR)) ... > > my script writes only empty lines. It

RE: readdir question

2005-09-30 Thread Thomas Bätzler
Hi, Gergely Buday <[EMAIL PROTECTED]> wrote: > this is a working code snippet: > > opendir (DIR, $dir) || die "Open failed: $!\n"; > > $\ = "\n"; > while ($_ = readdir(DIR)) { print; }; > > But when I try to use > > while (readdir(DIR)) ... > > my script writes only empty lines. It seems that

readdir question

2005-09-30 Thread Gergely Buday
Hi, this is a working code snippet: opendir (DIR, $dir) || die "Open failed: $!\n"; $\ = "\n"; while ($_ = readdir(DIR)) { print; }; But when I try to use while (readdir(DIR)) ... my script writes only empty lines. It seems that the proper number of empty lines are written. Does the prepended