Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: More efficient munging if infile very large

by Masem (Monsignor)
on Jul 26, 2001 at 15:32 UTC ( [id://99945]=note: print w/replies, xml ) Need Help??


in reply to More efficient munging if infile very large

Why not:
@in = map { $uclc eq 'lc' ? lc : uc } @in;
And avoid the extra variables althogether, and get $_ set for you all at once? Since you've already got $uclc checked for the right state, you don't need the second wasteful if.

Or, even better (1 if, instead of N...)

@in = $uclc eq 'lc' ? map { lc } @in : map { uc } @in;

-----------------------------------------------------
Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2024-04-19 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found