I mean, as Ghanja mentioned 'my' is the Perl equivalent of Lua's 'local', meaning it's localized to a singular method or file, which could be the issue. It should work correctly being you're initializing it outside of the subroutines as a lexical variable. Due to that, it should also be able to be modified and viewed from inside any subroutine within a given script. Have you attempted removing the 'my' keyword and making it a non-lexical variable and testing it to see if you get any different results?
|