Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: substitute within elements of array

by Anonymous Monk
on Apr 09, 2013 at 09:26 UTC ( #1027686=note: print w/replies, xml ) Need Help??

in reply to substitute within elements of array

but sadly it does not work

Sure it does

@array = qw[ SURE! IT! DOES! ]; foreach my $word (@array) { $word =~ s/(\.|\?|\!)$//; } die "@array"; __END__ SURE IT DOES at - line 6.

What is the reason you didn't post your @array?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1027686]
[PriNet]: quick question... anyone know how to remove all the existing keys in a %hash ? i've tried several options, but when i re-use the hash, some of the "upper" keys that i don't re-use stick and i can't get them to "remove"

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2017-06-28 02:46 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (619 votes). Check out past polls.