# This is the version that is most downwards compatible but doesn't handle # parentheses in default assignments sub transform_arguments { # This should also support # sub foo($x,$y,@) { ... }, throwing away additional arguments # Named or anonymous subs no warnings 'uninitialized'; s{\bsub(\s*)(\w*)(\s*)\((\s*)((?:[^)]*?\@?))(\s*)\)(\s*)\{}{ parse_argument_list("$2","$5","$1$3$4$6$7") }mge; $_ }