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

(zdog) Re: Sequential Replacement

by zdog (Priest)
on Jul 09, 2002 at 17:53 UTC ( #180555=note: print w/replies, xml ) Need Help??

in reply to Sequential Replacement

Here's a little different way of doing it that may give you some other ideas:

use strict; use warnings; my @array = qw (zero one two); my $str = "blah ##REP0## blah ##REP1##\nblah ##REP2##\n"; $str =~ s/##REP(\d+?)##/$array[$1]/g; print $str;

Update: Another idea is to replace the ##*##'s with %s and do:

$str = sprintf ($str, @array);

Just a thought ...

Zenon Zabinski | zdog |

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://180555]
[shmem]: you can break up the chain MP3::Tag->new($_)- >interpolate("\%S ") and test whether MP3::Tag->new($_) is true
[Lady_Aleena]: shmem, no to deletion.
[shmem]: can't help you there since that song is not on my bench
[Lady_Aleena]: shmem, I need to look at MP3::Tag to see how to get the date from one song.
shmem sticks himself into the envelope. gn.(1<<3) all

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (6)
As of 2017-04-23 22:19 GMT
Find Nodes?
    Voting Booth?
    I'm a fool:

    Results (432 votes). Check out past polls.