Why do you want the shortest? Here's one way to do it.
#!/bin/env perl use strict; use warnings; use List::Util qw(all); my $var = 'xyz'; if ( all { $var =~ $_ } ( qr/x/, qr/y/, qr/z/ ) ) { print "all in m8\n"; }
In reply to Re: ensure ALL patterns in string
by Mr. Muskrat
in thread ensure ALL patterns in string
by previous
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |