|
|
| We don't bite newbies here... much | |
| PerlMonks |
Re^4: unitialized value in subroutine entryby Anonymous Monk |
| on Jun 27, 2006 at 05:08 UTC ( [id://557744]=note: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.
thanks for taking the time to answer this. my basic problem is that i was NOT declaring the code variable BEFORE invoking it. i was getting "faked out" by adding the package name to the code variable to silence the "requires explicit package name" message. for some reason; perl doesn't complain about &$<package>::variable when this variable has not yet been declared! the lesson i learned is that private functions need to be declared identically to lexically scoped variables; BEFORE usage. here's the final code snippet : my problem was using the anonymous routine "formatThis1" which was declared at the end of the routine. my solution was to move the anonymous routine to the front of the routine ("formatThis0") note that the variable $somepackage::formatThis1 is supposed to be the code at the end of someroutine. however; it is not and that's what causes the unitialized variable at subroutine entry message (i think!)
Formatting fixed by GrandFather
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||