Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^2: Comments and suggestions on new module

by Anonymous Monk
on Sep 18, 2007 at 16:02 UTC ( #639687=note: print w/ replies, xml ) Need Help??


in reply to Re: Comments and suggestions on new module
in thread Comments and suggestions on new module

Ok... Care to elaborate with a quick code example?


Comment on Re^2: Comments and suggestions on new module
Replies are listed 'Best First'.
Re^3: Comments and suggestions on new module
by LTjake (Prior) on Sep 19, 2007 at 01:10 UTC
    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)

      I see. I update with this style in my next release, glad I didn't add to many more features now.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://639687]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2015-07-08 05:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (94 votes), past polls