in reply to how subroutine functions when declare "my" twice in main
So when you call it at runtime before it was initialized it's of course undefined.
(my does declaration at compile time and initialization at run time)
Sorry if I don't elaborate more on "broken" code, just don't do this ... there is a reason why you get warnings! :)
Cheers Rolf
( addicted to the Perl Programming Language)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how subroutine functions when declare "my" twice in main
by Anonymous Monk on Nov 05, 2013 at 19:36 UTC |