pos($titles) = 0;
For example,
my $titles = 'abcde'; for (1..2) { pos($titles) = 0; for (1..3) { $titles =~ /./g or die; print(substr($titles, pos($titles)-1, 1), "\n"); } }
prints
a b c a b c
You should probably be using index, though.
Update: Added example.
In reply to Re: Reseting pos()
by ikegami
in thread Reseting pos()
by EvanCarroll
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |