in reply to Re: Match operator giving unexpected output
in thread Match operator giving unexpected output
Hi Athanasius,
Thanks for the clarification.
My doubt arises from this statement from phase-3 of the quoted program
@cnt_arr = $string =~ /ink/g;
I though the content of left operand ($string) is not changed, so on which pointer =~ operator is working on?
I got the answer for resetting pointer from the link suggested by you.
pos($string)=0; just before phase-3 would do the job.
On another note, this behavior looks to C strtok() standard
library function which updates an internal pointer that is
not exposed but called should keep track of it!