in reply to Re: check if all certain chars are found in a sentence
in thread check if all certain chars are found in a sentence

I wonder if that could be re-written w/ hash slices?
#!/usr/bin/perl use strict; use warnings; my $sentence = "abxcd zwe rrv"; my $wantedLetters = "tzxv"; my %required; @required{split //,$wantedLetters}=(); delete @required{split //, $sentence}; if (keys %required) { print "required yet missing: ",keys %required,"\n"; } else { print "all requirements were met!\n"; }
Quick test... Yup, that works! Fun...

Mike