Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: array problem

by Trimbach (Curate)
on Mar 15, 2002 at 02:18 UTC ( #151888=note: print w/replies, xml ) Need Help??


in reply to array problem

A couple more suggestions. Instead of
opendir DIR, "$dir"; my @arr = grep -f, grep /\.jpg$/i, map "$dir/$_", readdir DIR;
you can do the same much more simply by just
my @arr = glob("*.jpg");
See "perldoc -f glob" for more information.

Also, when you call a subroutine you're gonna wanna do a &print_it or print_it(), but not a &print_it(). They are different, but you only have to tell Perl it's a subroutine once. :-D

Gary Blackburn
Trained Killer

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://151888]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2022-01-28 05:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (73 votes). Check out past polls.

    Notices?