Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Removing chars from a word from an array

by ikegami (Patriarch)
on Jan 24, 2006 at 14:55 UTC ( [id://525191]=note: print w/replies, xml ) Need Help??


in reply to Removing chars from a word from an array

for my $i (0..$#array) { $array[$i] =~ s/x//g; }
Or take advantage of the fact that foreach aliases the counter variable to the actual element of the list with the following:
foreach (@array) { s/x//g; }
That can also be written as
s/x//g foreach @array;

Update: Due to distractions, I incorrectly read the OP's question.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-26 04:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found