Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: $object->UnrelatedPackage::some_subroutine()

by itub (Priest)
on Feb 18, 2005 at 14:21 UTC ( [id://432337]=note: print w/replies, xml ) Need Help??


in reply to $object->UnrelatedPackage::some_subroutine()

Here's what perlobj says:
If you need to, you can force Perl to start looking in some other package:
my $barney = MyCritter->Critter::find("Barney"); $barney->Critter::display("Height", "Weight");

Here "MyCritter" is presumably a subclass of "Critter" that defines its own versions of find() and display(). We haven't specified what those methods do, but that doesn't matter above since we've forced Perl to start looking for the subroutines in "Critter".

As a special case of the above, you may use the "SUPER" pseudo-class to tell Perl to start looking for the method in the packages named in the current class's @ISA list.

Personally I don't like the style you are suggesting, because the use of this syntax suggests that DBI is a subclass of SomeDatabaseStuff (which would be a class, with my_funny_sql being a method), causing confusion.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-03-19 06:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found