our @common_letters = (); our @wordsCopy = @words; #### local our @common_letters; local our @wordsCopy = @words; #### local our @common_letters; local our @wordsCopy = @words; my $reference = shift @wordsCopy; $reference =~ /(.)(?{ ... })/gx; #### my @common_letters; my @wordsCopy = @words; my $reference = shift @wordsCopy; while ($reference =~ /(.)/g) { ... } #### for my $c($reference =~ /./g) # uses $c instead of $1 #### for my $c (split(//, $reference)) # uses $c instead of $1 #### my $bolean = 1; for ( @wordsCopy ) { if ( substr( $_, $position, 1 ) ne $letter ) { $bolean = 0; last } } $common_letters[ $position ] = $letter if ( $bolean ); #### for ( @wordsCopy ) { if ( substr( $_, $position, 1 ) ne $letter ) { $common_letters[ $position ] = $letter; last } } #### my @wordsCopy = @words; my $reference = shift @wordsCopy; #### my ($reference, @wordsCopy) = @words; #### for ( @splitWord ) { if ( $_->[$position] ne $letter ) { $bolean = 0; last } }