Good candidate for an OBFU. :-)

In the following example, $found is the number of unique vowels found in your string. Just test if it is equal to 5.
use strict; use warnings; my $word = "alighthousa"; my $found; if (($found = ( keys %{{map { $_ => 1 } ($word =~ m/([aeiou])/g) }} )) + == 5) { print "Found all 5 vowels\n"; } else { print "Found only $found vowels\n"; }

Ok, may be I should explain what is happenning here:

($word =~ m/([aeiou])/g) # returns a list of all vowels found in $word map { $_ => 1 } ($word =~ m/([aeiou])/g) # builds a list for initializing a hash { map { $_ => 1 } ($word =~ m/([aeiou])/g) } # a reference to an anonymous hash initialized with the list keys %{ { map { $_ => 1 } ($word =~ m/([aeiou])/g) } } # return keys of the dereferenced anonymous hash # the keys in a hash are unique, this effectively # eliminates duplicates, and gives a list of unique # vowels found in the string $found = ( keys ... ) # this assigns the number of unique vowels found into $found


In reply to Re: regex testing for ALL of the vowels in a scalar by Roger
in thread regex testing for ALL of the vowels in a scalar by D'Oh!!

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.