Regular Expression Perl

$p = "This is a pattern test.";
if ($p =~ /(\w)?/){ print "$1\n"; }