Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Removing chars from a word from an array

by ikegami (Patriarch)
on Jan 24, 2006 at 14:55 UTC ( #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? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2022-01-25 12:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (66 votes). Check out past polls.

    Notices?