I have the following global in variable in file_1.pl, in package main:
package main;
my $var = -1;
If I need to update this variable from another perl file, what is the way of doing it? I tried:
$main::var = 1
But it did not work.
What is the correct way of doing it?
Thank You!
you have to declare the variable with
ourotherwise it would be considered as lexical variable so change it like