Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Any chance of a require? I do like it over use base even if the only thing changing between the two is that you can say isa Bar instead of use base "Bar". There is one slight catch, though:

#!/usr/bin/perl -wl our @ISA; use isa; isa Foo,Bar; # drops Bar and also spits out warning... # works same if you quote Bar, dies if Foo # is quoted or we're under strict print "@ISA"; @ISA = (); Foo->isa("Bar"); # this works but the syntax is...funky print "@ISA"; @ISA = (); UNIVERSAL::isa(qw(Foo Bar)); # kinda long, eh? print "@ISA"; @ISA = (); main->isa(qw(Foo Bar)); # makes sense... pushes itself onto # @ISA, though __END__ Useless use of a constant in void context at isa.pl line 5. Foo Foo Bar Foo Bar main Foo Bar

It doesn't do the right thing if you'd like to declare it for more than one package at a time. With base you can do as many as you want. The only ways I can think of fixing it is to actually export a version to the package that's using isa's functionality. I dunno. Works great for one package but otherwise doesn't seem to be as clean of a solution as it could be.


In reply to Re: package Foo; isa Bar; why not? by !1
in thread package Foo; isa Bar; why not? by liz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (4)
As of 2024-04-24 21:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found