c:\@Work\Perl\monks>perl -wMstrict -le "my $str = 'abc'; while ($str =~ m/./gc) { printf qq{1: %d \n}, pos $str; } ;; printf qq{2: %d \n}, pos $str; print 'pos at end' if pos $str == length $str; " 1: 1 1: 2 1: 3 2: 3 pos at end