my $matched = do { my $i = length $_; $_ eq substr "foobar",0,$i; };