in reply to Re^2: Iterate multiple arrays with added text
in thread Iterate multiple arrays with added text
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!
|
|---|