> use strict;
>
>>> 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"

gives:
> Global symbol "$hr" requires explicit package name at foo.pl line 11.
> Global symbol "$hr" requires explicit package name at foo.pl line 11.
> Execution of foo.pl aborted due to compilation errors.

cheers,

Garrett

_______________________________________________
kc mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/kc

Reply via email to