sub foo { my $x; BEGIN { $x = 3 }; say $x }
  foo; foo; foo;

Currently in perl5 and pugs this prints "3\n\n\n".

Should BEGIN blocks be able to modify values in lexical variables that
don't really exist yet? (People can use state after all to get a
variable which does exist early enough for them to modify.)


Is there some kind of "prototype pad" (and lexicals) available inside
the BEGIN block, rather than a full runtime pad?

-- 
Benjamin Smith <[EMAIL PROTECTED], [EMAIL PROTECTED]>

Attachment: pgpRkLbUAMFJ0.pgp
Description: PGP signature

Reply via email to