Hi, @titles in scalar context returns the number of elements in the array. But the index of the last element is one less than that.
To loop through the indices of your array, use $#titles instead, which will give the index of the last element.
for my $i ( 0 .. $#titles ) { ... }
Hope this helps!
In reply to Re^3: Iterate multiple arrays with added text
by 1nickt
in thread Iterate multiple arrays with added text
by Bman70
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |