in reply to Re^2: conditional definition of variables
in thread conditional definition of variables

"Definition" (or declaration) of the variable happens at compile time. The conditional happens at run time.

So, if you have

my $var = "..." if EXPR;
you will have all the compile time effects, and maybe the runtime effects. This was abused (with 'EXPR' being 0) to get "state" variables in 5.8 and before (which didn't always 'work'), which in turn let to the "state" keyword in 5.10.