Beefy Boxes and Bandwidth Generously Provided by pair Networks
Come for the quick hacks, stay for the epiphanies.
 
PerlMonks  

OO Inheritence

by Limbic~Region (Chancellor)
on May 25, 2004 at 17:51 UTC ( [id://356319]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package Vehicle;
    use strict;
    ...
        $AUTOLOAD->( @_ );
    }
    1;
    
  2. or download this
    package Bike;
    use base Vehicle;
    ...
        return defined $valid{$option} ? 1 : 0;
    }
    1;
    
  3. or download this
    package Car;
    use base Vehicle;
    ...
        return defined $valid{$option} ? 1 : 0;
    }
    1;
    
  4. or download this
    #!/usr/bin/perl
    use strict;
    ...
    
    # We don't allow Frankestein cars
    print "My first car had ", $car_1->Wheels, " wheels\n";
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://356319]
Approved by gjb
Front-paged by TStanley
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2024-04-18 09:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found