in reply to Re^5: Perl variable scoping between functions
in thread Perl variable scoping between functions

Aha! I think that this is certainly a likely cause, passing the path to the file as a hardcoded string will yield the required result so I think you are right that it could be the assignment that is incorrect.
  • Comment on Re^6: Perl variable scoping between functions