Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: find and replace

by vivid (Beadle)
on Dec 21, 2007 at 09:36 UTC ( #658413=note: print w/ replies, xml ) Need Help??


in reply to find and replace

Try this

my %aff; while($str=~/<affiliation id="([^"]*)"><label>(.+?)<\/label>/sgi){ $aff{$1}=$2; } for my $affid (sort keys %aff){ $str=~s#(<crossRef refid=")(">\Q$aff{$affid}\E</crossRef>)#$1$affid$2# +sgi; }

Vivid


Comment on Re: find and replace
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2014-08-23 07:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (172 votes), past polls