Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: replace conditionals with polymorphism

by chromatic (Archbishop)
on Feb 09, 2009 at 20:01 UTC ( #742560=note: print w/ replies, xml ) Need Help??


in reply to Re: replace conditionals with polymorphism
in thread replace conditionals with polymorphism

package UI; our @ISA = '';

Careful; you've just inherited from a class with no name.


Comment on Re^2: replace conditionals with polymorphism
Download Code
Re^3: replace conditionals with polymorphism
by Corion (Pope) on Feb 10, 2009 at 08:29 UTC

    You likely know this, but others mightn't:

    Perl provides the class with no name. It's identical to the main:: namespace:

    package Hello; @Hello::ISA=''; package main; sub p { print for @_ }; Hello->p('World')

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (16)
As of 2014-09-19 13:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (138 votes), past polls