in reply to variable access

You declared the variable with my. It means its scope is limited - it exists only till the following closing curly bracket.

Why do you need the variable? You can declare it outside the sub to make it accessible to the outer code, but there might be a better solution to your problem - but we don't know the problem.

لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: variable access
by aioan1 (Acolyte) on Jan 06, 2015 at 11:39 UTC
    I need that variable for another querry in MongoDB and my problem is that I cannot use it outside the subroutine, I printed it only to see it.