The code below prints the uid as expected from within the foreach loop. However, it will not print it in the subroutine. Why not and how can I fix it?
The reason is that the foreach loop localises $uid; but the subroutine mail closes over the variable declared above and outside the foreach loop, which is never initialised or assigned to.
In reply to Re: Scalar Value Not Available To Subroutine
by BrowserUk
in thread Scalar Value Not Available To Subroutine
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |