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

Re^2: RFC: Data::Taxonomy::Tags

by Jenda (Abbot)
on Jun 23, 2005 at 00:59 UTC ( [id://469255]=note: print w/replies, xml ) Need Help??

in reply to Re: RFC: Data::Taxonomy::Tags
in thread RFC: Data::Taxonomy::Tags

package base; use overload '""' => sub { shift->as_string }, # '""' => \&as_string, fallback => 1; sub as_string { "this is a base class" } package child; @ISA = qw(base); sub as_string { "this is a child class" } package main; $obj = bless {}, "child"; print "\$obj=$obj\n";
Try both versions. Do you see the difference? The original version calls the as_string method of the object (which may be either an instance of the base class or a child) while the second calls always the as_string subroutine in the base class.

XML sucks. Badly. SOAP on the other hand is the most powerfull vacuum pump ever invented.

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (3)
As of 2024-07-17 19:35 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.