You don't need to do s/// - and you're not checking that the regex has actually matched, before copying $1 into your own variables. In other words, all three of your variables get set to $1 each time round the while loop.
Try replacing:
s/<volume>(.*)<\/volume>//;$vol=$1; s/<issue>(.*)<\/issue>//;$iss=$1; s/<year>(.*)<\/year>//;$yr=$1;
with:
$vol = $1 if /<volume>(.*)<\/volume>/; $iss = $1 if /<issue>(.*)<\/issue>/; $yr = $1 if /<year>(.*)<\/year>/;
(Note: untested)
In reply to Re: problem with variables
by muntfish
in thread problem with variables
by texuser74
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |