for (my $i=0; $i <= $#{@alarms}; $i++) { print $alarms[$i]; } #### for (my $i=0; $i <= $#alarms; $i++) { print $alarms[$i]; }