foreach my $array ( @{$arrayRef} ) { my @matches = $array->[1] =~ /[0]." --> ".$_}@matches; print $_,"\n" for @matches; }