in reply to Basic Print statement question

It depends on what scope the print statement falls into. Consider:
$foo = 'foo'; sub foo { print $foo . "\n"; my $foo = 'bar'; print $foo . "\n"; } foo;
which outputs:
foo bar
Never do that in real code if you can help it.

Here, the scope of the global $foo is everywhere it's not masked by another variable with that name. Within the subroutine, it is only masked from the point the lexical $foo is declared until the end of the block. The sub has two different values for two different variables with the same name. That's a mess, and would be better avoided than implemented correctly. Implementing it correctly with the two variables named the same is just asking for someone to move the declaration of the lexical or the use of the global, and then you've got broken code.

You might not be able to control the naming of the global, but one would hope that you can control the name of the lexical. I would carefully name it something different.