How about using split rather than index? Using cdarke's extended data shows that you have to use a third argument to split of -1 to allow the trailing empty element if the split term is at the end of the line.
$ perl -le ' > $str = q{YYSFTVMETDPVN[115]HMVGVISVEGRPGLFWFN[115]ISGGDKN[115]}; > @chunks = split m{(?<=N)\[115\]}, $str, -1; > $posn = -1; > print $posn += length for @chunks[ 0 .. $#chunks - 1 ];' 12 30 37 $
I hope this is of interest.
Cheers,
JohnGG
In reply to Re: How to run index on this one?
by johngg
in thread How to run index on this one?
by Anonymous Monk
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |