If possible I would like to use variable that is accessible bye ref_test2 without passing in as argument.So you mean you want to share a variable between functions? The solution here is to use a lexical within a closure:
{ # closure starts here my $shared_variable; sub ref_test1 { ... } sub ref_test2 { ... } }
In reply to Re^5: Unable to declare local variable with "use strict".
by rovf
in thread Unable to declare local variable with "use strict".
by mr_p
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |