master perl (read all 8 entries…)
Perl Tidbit #1 4 years ago

Here’s something I learned the other day while rereading Learning Perl 3rd Ed. The glob operator doesn’t spawn a new process or invoke the shell or anything expensive like that anymore, so you can actually build directory content listings in a manner that makes sense!

my @images = glob "*.jpg";

... or even the operator version, which I can’t get to display properly for some reason.

Of course, you still want File::Find for recursive trips. Still, this is good to know for basic stuff.



Comments:

 

I want to:

The world wants to...

43 Things Login