in reply to Re^3: Variables in a single file
in thread Variables in a single file
Name "main::x" used only once: possible typo at ... warning.
But putting the require into a begin block really helps. 8)
> cat mod.pm tren prog.pl tren; perl prog.pl $x="X"; 1; ------------------------ use strict; use warnings; #our $x; #BEGIN { require mod; #} print $::x; ------------------------ Name "main::x" used only once: possible typo at prog.pl line 10. X
Cheers Rolf
|
|---|