[Kc] complex initialization of a state variable in current perl (5.8.7)

Don Ellis don.ellis at gmail.com
Tue May 8 07:56:28 PDT 2007


It is so cool to be able to just paste this into a BBEdit text window  
and then select "Run" from the #! menu! And, no need to save or name  
a file or anything!

MacOS X Rocks!

[How come I still get excited, even after having done it this way for  
years? Of course, having to put up with Win* contributes.]

--Don Ellis


  I tend to think of [Mac] OS X as Linux with QA and Taste.
  -James Gosling, Java Architect



On May 7, 2007, at 7:36 PM, David Nicol wrote:

> sub foo{
>         my $hr if 0;
>         BEGIN{
>                 $hr = {foo => 23}
>         }
>         print $hr->{foo},"\n";
> };
> defined $hr and die "$hr is defined outside of scope";
> foo();  # yes indeedy-doo, prints "23\n"



More information about the kc mailing list