In addition to Daedalus207' fix, you are also missing a close paren literal in your subroutine regex:
my $subroutine = qr/((\w+::)*\w+\($sub_args\))/; # ^
You might also want to add some optional whitespace at strategic points unless you are striping this first.
Your regex would be easier to read and maintain if you used /x.
my $subroutine = qr/ ( (\w+::)* \w+ \( $sub_args \) ) /x;
In reply to Re: Nesting regexen
by BrowserUk
in thread Nesting regexen
by colink
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |