in reply to Re^2: Perl Errors
in thread Perl Errors
If you declare the second $variable in the same scope, you cannot access the value of the previously declared variable anymore.
If you declare the second $variable in a different scope, you cannot access the value of the previously declared variable while you are in that scope. Leaving that scope, the earlier variable will suddenly re-appear. As you will understand, this can cause all kinds of weirdness and confusion, so don't do it unless you have a very good reason for it.
CountZero
A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
My blog: Imperial Deltronics
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Perl Errors
by Hellhound4 (Novice) on Mar 27, 2012 at 20:47 UTC | |
by ww (Archbishop) on Mar 27, 2012 at 21:23 UTC | |
by CountZero (Bishop) on Mar 27, 2012 at 21:23 UTC | |
by Hellhound4 (Novice) on Mar 27, 2012 at 21:59 UTC | |
by ww (Archbishop) on Mar 27, 2012 at 22:07 UTC | |
by Hellhound4 (Novice) on Mar 27, 2012 at 22:30 UTC | |
|