@coords = ( undef, # use a null $coords[0] [13,9,6], [184,9,6], ... ); for my $goal ( 1..100 ) { for my $well ( @existing_wells ) { my $img = ( $well == $goal ) ? $graph_links[$goal-1] : "array.bmp"; my $coords = join ',', @{coords[$goal]}; print qq(); } }