Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
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 examining the Monastery: (6)
As of 2015-07-02 23:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (47 votes), past polls