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

Re: Replacing matches within string without splitting.

by 2teez (Priest)
on Jan 02, 2013 at 06:39 UTC ( #1011211=note: print w/ replies, xml ) Need Help??


in reply to Replacing matches within string without splitting.

something like this?

my @array = ( 1, 2, 3, 4, 8, 9, 10, 11, 7, 8, 9, 10, 12, 13, 14, 15 ); for (@array) { $_ < 10 ? print "0", $_, $/ : print $_, $/; }

output

01 02 03 04 08 09 10 11 07 08 09 10 12 13 14 15

If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me


Comment on Re: Replacing matches within string without splitting.
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2014-07-10 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (198 votes), past polls