in reply to Using and renaming same variables/hash within different subroutines

Because you are using the my keyword you do not need to worry about this, ie you do not need to distinguish the variables used.
sub initialize { my ($resource_ref,$portoffset) = @_; }
Where you pass references to the resource hash they are all pointing to the same thing and where you pass the value of $portoffset there can be no collision as my lexically scopes the variable to within the block.

If you need the subroutines not to interfere with %resources, you'll have to copy the values into a local hash for manipulation in the subroutines