## Assign appropriate values to 3 different slots in the glob *t = sub{ print 42 }; *t = \'fred'; *t = [ 1,2,3];; ## And print them print join "\n", t(), $t, "@t";; 42 1 fred 1 2 3 ## Locally override the code slot and print them--the others are untouched. { local *t = sub { print 'changed' }; print join "\n", t(), $t, "@t"; };; Subroutine main::t redefined at (eval 5) line 1, line 3. changed 1 fred 1 2 3 ## print them again having exited the block, ## and they all retain their original values print join "\n", t(), $t, "@t";; 42 1 fred 1 2 3