for my $cont_name (@cont_names) { # do stuff with $cont_name } #### for ($c=0; $c < scalar(@cont_names); $c++) { # do stuff with $cont_names[$c] }