I'm not really sure it is though. It's more compact, to be certain. Assuming what I did in removing the dotfiles is an invariably desired behavior, the glob works fine. But I'd rather use an explict readdir on account of, what if I decide I want the dotfiles after all? If I'm using a readdir I only have to change the grep to grep { ! /^\.\.?$/ } or grep { /[^\.]/ } whereas if you're using glob, you have to change the whole thing to use the readdir anyways. And so if you always start with glob, as soon as you need a dotfile you'll find yourself with a mixed bag using both. Hardly more readable, that.
If the tools isn't a sysadmin tool, it might be fine to assume you're not wanting to include dotfiles.
--
Snazzy tagline here
In reply to Re: Re: Re: Opening Unknown Filenames
by Aighearach
in thread Opening Unknown Filenames
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |