#!/usr/bin/perl use strict; use warnings; use Math::Combinatorics; #to get all combinations my $input = ; my @inputarray = split('',$input); my $file = 'wordlist.txt'; open(INFO, $file); my @lines = ; close(INFO); my @permutations= map { join "", @$_ } permute(@inputarray );# Get all permutations of input string my %dup; @dup{@permutations}= (); my @tacobell= grep { exists $dup{$_} } @lines; # Check if any of the combinations exists in file print join ("\n",@tacobell); exit();