Using local creates a temporary instance of the named variable, and you can do what you like with it.
But this does not apply to all special globals, i.e.:
% perl -e 'local $1 = 1' Modification of a read-only value attempted at -e line 1. % perl -e 'local $^S = 1' Modification of a read-only value attempted at -e line 1.
-- Frank
In reply to Re^2: (nearly) readonly globals
by haoess
in thread (nearly) readonly globals
by haoess
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |