my $subroutine = qr/((\w+::)*\w+\($sub_args\))/; # ^ #### my $subroutine = qr/ ( (\w+::)* \w+ \( $sub_args \) ) /x;