Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: uc() every other letter

by Aristotle (Chancellor)
on Sep 28, 2001 at 14:46 UTC ( [id://115361]=note: print w/replies, xml ) Need Help??


in reply to uc() every other letter

my @mixed_case = 'a' .. 'z'; my $other_letter = 0; $_ = uc() for grep ++$other_letter % 2, @mixed_case;

Replies are listed 'Best First'.
Re: Re: uc() every other letter
by virtualsue (Vicar) on Sep 28, 2001 at 22:21 UTC
    MiNi kRaZy golf on the modulus theme:
    my $i=0; my @a = ('a'...'z'); $i++%2||($_=uc)for@a;
      I can trim one char off of that....
      $i++%2or$_=uc for@a;

      -Blake

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (5)
As of 2024-04-20 10:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found