package X; our $PREF; sub new { bless {}, $PREF; } package A; sub foo { print __PACKAGE__; } package B; sub foo { print __PACKAGE__; } package main; $X::PREF = 'B'; my $o = X->new; $o->foo;
Prints:
B
You can change $X::PREF = line to 'A' and it will print A.
--
"Go up to the next female stranger you see and tell her that her "body is a wonderland."
My hypothesis is that she’ll be too busy laughing at you to even bother slapping you." (src)
In reply to Re^3: Comments and suggestions on new module
by LTjake
in thread Comments and suggestions on new module
by cosmicperl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |