use strict; use warnings; use Quantum::Superpositions; my ($str1, $str2) = @ARGV; die "Usage: $0 " if ! defined $str2; print In_Common($str1, $str2), "\n"; sub In_Common { my ($str1, $str2) = @_; return join '', eigenstates( all( any( split( //, $str1 ) ), any( split( //, $str2 ) ) ) ); } #### use strict; use warnings; use Quantum::Superpositions; print In_Common( @ARGV ), "\n"; sub In_Common { return join '', eigenstates( all( map { any( split( //, $_ ) ) } @_ ) ); }