- or download this
sub is_valid_re {
eval { qr/$_[0]/ };
return $@ ? 'NO' : 'YES';
}
- or download this
sub is_valid_re { eval { qr/$_[0] } ? 'YES' : 'NO' }
- or download this
sub is_valid_re { eval { qr/$_[0] } }
print is_valid_re('abc') ? 'YES' : 'NO';
sub human_bool { shift ? 'YES' : 'NO' }
print human_bool(is_valid_re('abc'));