Both of them are used to declare local variables
No. local does not declare a variable, as you can easily try out:
$ perl -Mstrict -e 'local $x' Global symbol "$x" requires explicit package name at -e line 1. Execution of -e aborted due to compilation errors.
If local declared a variable you wouldn't get an error message here.
In reply to Re^2: Difference b/w my and local var?
by moritz
in thread Difference b/w my and local var?
by anbutechie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |