$class = ‘[a-z]’; @commonChars = compareChars( $class ); sub compareChars { $regex = shift; $requiredCount = @ARGV; for ( $i=0; $i<=$#ARGV; $i++ ) { while ( $ARGV[$i] =~ m/($regex)/gi ) { $found{$1} = $i + 1; } } while ( ( $key, $value ) = each %found ) { push @answer, $key if $value == $requiredCount; } return @answer; }