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

Re: String replacement

by Tanalis (Curate)
on Jul 21, 2005 at 14:30 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://476850]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found