By not creating it a lexical variable. Leave the my
off. Of course, you either have to get rid of the strictness,
use use vars, or use a fully qualified name.
Well, you don't shows it what you did, nor the error
message you got, so it's hard to respond. However, you
say use vars;, which suggest you are not
using this pragma right. Do you know what use vars
does? If not, why do you use it in your program? Never, ever
use something in your program just because you heard it on
Perlmonks, read it in the newspaper, or saw in on television.
First read the manual page - and only when you understand
you are allowed to use it.