in reply to nested subroutines

Is there any reason you need this to be a nested sub? What's wrong with making it a normal sub and calling it from within the findTargetAttribute sub? Note that this is a real question -- I'm failing to see a reason this couldn't be done... unless perhaps it has something to do with scoping issues.