Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: String replacement

by Tanalis (Curate)
on Jul 21, 2005 at 14:30 UTC ( #476850=note: print w/replies, xml ) Need Help??


in reply to String replacement

Probably not the best way to do it, but this works:
my $a = "ABABA"; my $b = "BB--B-BB"; $b =~ s/B/\%c/g; printf $b, unpack 'c*', $a;
Gets rid of the loop, at least *grin*.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://476850]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2017-07-26 16:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I came, I saw, I ...
























    Results (398 votes). Check out past polls.