$line = ; if($line =~ /^[Aa]+.*$/){ print "This line matches your pattern.\n"; } else{ print "This line doesn't match your pattern.\n"; }