Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: The "<" in the grep block

by 2teez (Priest)
on Sep 23, 2012 at 18:17 UTC ( #995229=note: print w/ replies, xml ) Need Help??


in reply to Re^2: The "<" in the grep block
in thread The "<" in the grep block

I agree that

@ARGV = map{glob} @ARGV; ....
does work, however, I think since "glob" can do the expansion, why not use
my @smaller_than_1000 = grep { -s $_ < 1000 } glob("@ARGV"); ....
see glob for detail.

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me


Comment on Re^3: The "<" in the grep block
Select or Download Code
Re^4: The "<" in the grep block
by BrowserUk (Pope) on Sep 23, 2012 at 18:24 UTC

    That works for this application, but wouldn't for the more common uses:

    BEGIN{ @ARGV = map glob, @ARGV } while( <> ) { ... }

    And

    perl -eBEGIN{@ARGV=map{glob}@ARGV} -nle"1" a*.pl b*.pl

    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    RIP Neil Armstrong

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (15)
As of 2014-09-30 17:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (379 votes), past polls