go ahead... be a heretic | |
PerlMonks |
Re: can't use string refs while "strict refs"by Marshall (Canon) |
on Jul 30, 2012 at 06:34 UTC ( [id://984359]=note: print w/replies, xml ) | Need Help?? |
You have sort of copied an example straight out of the Perlretut without really understanding what it does. I would say that not everything that you read in the tutorials is common - there are some very complicated and rare things - and this is one of them! This is so rare, that I don't think that it is worth delving into the mind-numbing details. VERY seldom do you even care in the slightest about the pos(position) of a match - that is 'C' thinking. Perl regex is most commonly used to capture stuff that is between other stuff and whether this happens at index 5 or 95 usually just doesn't make any difference at all. The purists would say: "well sometimes it does matter" and I would agree with them. What I am saying here is that the pos() almost always does not matter. I show some more common ideas in Perl below.
In Section
Seekers of Perl Wisdom
|
|