Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^6: Tidy up conditionsby tel2 (Pilgrim) |
on Mar 21, 2015 at 01:35 UTC ( [id://1120820]=note: print w/replies, xml ) | Need Help?? |
Hi again Martin,
I've incorporated the // in my code like this: Unfortunately, when the regex doesn't match, it seems to short-circuit, and this is printed: level='' Any ideas why? I assume it's something to do with the line which contains the regex not being 'defined', but I'm not sure. Meanwhile, I've worked around it by putting the regex first, like this: And I think that's working (i.e. it prints "level='30'" in the above case). If you've got a better adjustment to this code, which doesn't involve using that regex unless needed, I'd love to see it. Otherwise, no worries - I'm pretty happy. Thanks again.
In Section
Seekers of Perl Wisdom
|
|