in reply to Match operator giving unexpected output

What is the source of your expectations ? Why do you expect what you do?

See Re: meaning of =()= (null list accumulator, list counter), Context tutorial, http://perldoc.perl.org/perlop.html#Matching-in-list-context, perlfaq6#What good is \G in a regular expression?,

  • Comment on Re: Match operator giving unexpected output (source)

Replies are listed 'Best First'.
Re^2: Match operator giving unexpected output (source)
by ysreenu (Initiate) on Jan 13, 2015 at 09:53 UTC
    Hi anonymous
    Thanks for asking.
    My expectation is naive in the sense that when variable value is unchanged why is the
    match operator not matching all occurrences of substring from the beginning of string.
    But as per the link provided by Athanasius, pos() function would either return the current matching offset or
    can be set the offset to influence the next matching operation.
    Because of this discussion, I got to learn a new function.