http://www.perlmonks.org?node_id=78793


in reply to Expression, but is it regular?

You're probably looking for something like that:

my $dirtype = $in{username} =~ /^([a-zA-Z]{2})$/ ? $1 : 'other' ;

<kbd>--
my $OeufMayo = new PerlMonger::Paris({http => 'paris.mongueurs.net'});</kbd>