In all but the first iteration, the last regexp isn't matched, resulting in a repeat of the article title. (I guess that the backreference from the regexp to capture the article title is assigned to $source_journal, which is then printed)
Captures like $1 are only valid if a regex actually matched... So the solution would be to test if it matched, and assign some other (default) value to $source_journal in case it didn't.
if ($new_url =~ m{(...)}) { $source_journal = $1; } else { $source_journal = '(not specified)'; }
In reply to Re: How to prevent a value from being repeated?
by almut
in thread How to prevent a value from being repeated?
by turbolofi
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |