in reply to Re: Declareing something with a *
in thread Declareing something with a *

This being because globs operate on the symbol table and variables declared with my don't end up in the symbol table.

Declaring variables in perl really does seem quite a mess, between use vars,my,our,local,strict on/off. Doesn't matter 99% of the time but every so often something doesn't work quite the way I expect and it annoys me.

Replies are listed 'Best First'.
Re: Declareing something with a *
by Abigail-II (Bishop) on May 18, 2004 at 15:04 UTC
    Declaring variables in perl really does seem quite a mess, between use vars,my,our,local,strict on/off.

    Whether strict is on or off doesn't matter for the type of variable. Strictness doesn't change the meaning - it just prevents you from doing certain things. Use the following table:
     Package varLexical var
    Global scopeuse vars
    Lexical scopeourmy
    local creates dynamically scoped values - it doesn't declare variables.

    Abigail