Refactoring with Class::Accessor
grep my | split to variables | sort | uniq to list all locals
pick which ones should be fields
group them into sets by usage
continued...