Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: rtfm

by grinder (Bishop)
on Jun 22, 2004 at 09:42 UTC ( #368651=note: print w/ replies, xml ) Need Help??


in reply to rtfm

Heh! This gave me a big laugh (but then that's my sense of humour). On my fifth try I pulled up the perl manpage. How odd.

I would humbly suggest filtering out the directories returned by readdir:

push(@bins, grep { -f $_ } @content);

Normally I would suggest $_ ne '.' and $_ ne '..' but as in this case we don't care to see directories or any other weird things, the -f will do the trick nicely.

Another thing, if system is the last statement in your program you may want to consider execing the program instead, as you really don't need/care to hang around to see what happens.

- another intruder with the mooring of the heat of the Perl


Comment on Re: rtfm
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2014-12-17 20:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (33 votes), past polls