in reply to Re: Accessing array elements
in thread Accessing array elements

foreach my $i (0 .. ($#array/2) - 1) { ... }
This produces an off-by-one error. Either
    ($#array/2)
or the uglier
    (@array/2) - 1
works as I understand the OPer requires.
>perl -wMstrict -le "my @ra = qw(a A b B c C d D e E); for my $i (0 .. ($#ra/2) - 1) { print qq{$ra[ $i * 2 ] : $ra[ $i * 2 + 1 ]}; } " a : A b : B c : C d : D >perl -wMstrict -le "my @ra = qw(a A b B c C d D e E); for my $i (0 .. ($#ra/2)) { print qq{$ra[ $i * 2 ] : $ra[ $i * 2 + 1 ]}; } " a : A b : B c : C d : D e : E