in reply to Re^4: If condition failing..
in thread If condition failing..

Can't use string ("6") as a HASH ref

This is probably because somewhere else you still have $pathname_versions{$1}{$2}.

So, if $pathname_versions{$1} is now "6", for example, the {$2} would be trying to dereference the value "6", i.e. "6"->{$2}, which doesn't make much sense...