This behavior is documented very clearly:
perldoc -f my
A "my" declares the listed variables to be local
(lexically) to the enclosing block, file, or "eval".
There no such thing as a "package scope". To do what you want you'd have to use blocks:
my $var = 1;
my $var = 5;
Global symbol "$var" requires explicit package name at - line 16.
Execution of - aborted due to compilation errors.
Also, FYI warnings and strict are filescoped also if they aren't in a more specific container.