in reply to perl script to print just directory names
What extra line? Just tested your code on my system and don't see an extra line. There *is* however a "blank line" between the last line the script generates and the command line prompt but I think that's a function of the shell.
Some more comments:
Not sure why you are doing this:
whenwhile(defined($file = readdir($dh)))
should suffice.while($file = readdir($dh))
You do realize your array is going to be empty when your loop is done?
Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg
|
---|
In Section
Seekers of Perl Wisdom