in reply to getting count of method params

You can read perlre and perlretut. I would start with something like this, assuming all methods definition will be in one line:

while (<DATA>) { if (/^ # Matches line start \s* # None or many spaces (?:public|private)? # Matches 'public', 'private' or none (pac +kages) \s+ # One or many spaces (?:\S+) # Matches one or more non spacing chars (v +ariable type) \s+ # One or many spaces (?:\S+) # Matches one or more non spacing chars (m +ethod name) \s* # None or many spaces \( # Literal '(' (.*) # Matches everything \) # Literal ')' \s* # None or many spaces $ # Matches end of line /x) { print $1, "\n"; } } __DATA__ public void check1(String str, Integer i) { }

Igor 'izut' Sutton
your code, your rules.