$a = ("abc" =~ /a(b)c/)[0] || 'd'; print $a;