in reply to Re: Type globs, strict, and lexical variables
in thread Type globs, strict, and lexical variables

Cool! never would have thought I could localize a typeglob itself. Hmmmm... will this really work, since you can't localize a variable that doesn't pre-exist, under strict.
  • Comment on Re^2: Type globs, strict, and lexical variables

Replies are listed 'Best First'.
Re^3: Type globs, strict, and lexical variables
by ikegami (Patriarch) on Jul 17, 2006 at 07:40 UTC
    you can't localize a variable that doesn't pre-exist, under strict.

    That's not true. strict has nothing to do with local. For example,
    perl -Mstrict -e "local $Package::foo"
    give no error.
    perl -Mstrict -e "local $foo"
    gives an error, but so does
    perl -Mstrict -e "$foo"

    will this really work

    Strict doesn't apply to globs (since they can't be declareds), so
    perl -Mstrict -e "*foo"
    and
    perl -Mstrict -e "local *foo"
    give no error.