Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: (Mis)Understanding <c>grep...eq $_<c>

by ikegami (Patriarch)
on Feb 24, 2009 at 07:09 UTC ( [id://745920]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    >perl -le"@a = qw( a b c d ); @b = grep { push(@a,'!') if !$i++; 1 } @
    +a; print @b"
    abcd
    
  2. or download this
    >perl -le"@a = qw( a b c d ); for (@a) { push(@a,'!') if !$i++; push @
    +b, $_ } print @b"
    abcd!
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://745920]
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: (2)
As of 2024-04-16 23:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found