in reply to Re: Re: switcher
in thread switcher

Yes, two perlfunc:shifts or a perlfunc:splice would be faster than grep, if you can absolutely always rely on . and .. being the first two items listed in a directory. Which you probably can't even if that is the case on your system.

A false return on opendir means that the system had a reason why it couldn't read what was in the directory (probably no read permission for user, you can find out in $!). This means that the call to readdir would fail (I think it would be fatal under warnings and strict) or if the program tried to keep on going @fools would be empty, causing other problems.