$ perl -E 'my $x = "A(B"; substr $x, index($x, "("), 1, "<"; say $x' A