Dag nabbit.. forgot the anchors :) if ($letter =~ /^[A-L]$/) {
-------------------------- Hello Andy, if ($letter =~ /[A-L]/) { blah } See Also: perldoc perlre Cheers, Kevin On Wed, Dec 05, 2001 at 02:16:37PM -0500, Nguyen, Andy ([EMAIL PROTECTED]) said something similar to: > Hi List, > > I am new to perl and looking for a shortcut way of doing this. > > # $letter could be any letter from A to L. > if ( $letter eq "A" || $letter "B" || $letter "C" || $letter eq "D" ............ || >$letter eq "L" ) > { > do something > } > > I really don't want to repeat $letter for every letter (B-L). > -- [Writing CGI Applications with Perl - http://perlcgi-book.com] "The California crunch really is the result of not enough power-generating plants and then not enough power to power the power of generating plants." -- G.W. Bush, Interview with New York Times 01/14/2001 -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]