in reply to Re: Checking the command line arguments
in thread Checking the command line arguments

However it is not visible to another package.

Be careful here. Lexical variables don't care about packages, lexicals and packages are completely orthogonal concepts.

use strict; my $x = 42; { package OtherPackge; print $x, "\n"; }

Lexical variables are visible within the current block, and each file is implicitly enclosed in a block.