in reply to execute loop code for every occurence of regex

I think the problem is your .*. If you look closer, I think you'll find it's finding the first |i, but the last |l. .* tries to match as much text as it can, so it scoops up all your other codes. If you use the non-greedy .*? it should do what you want.
while($line =~ /\|i([^|]*).*?\|l([^|]*)/g) {

Replies are listed 'Best First'.
Re^2: execute loop code for every occurence of regex
by aquarium (Curate) on Sep 08, 2004 at 15:30 UTC
    thank you...i'm a silly duffer...and it's important database field updates..thanks heaps.