Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Pure Virtual Functions

by Arunbear (Prior)
on Feb 07, 2009 at 19:27 UTC ( #742160=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package Foo;
    
    ...
    has 'name' => (is => 'rw');
    
    1;
    
  2. or download this
    package Abc;
    
    ...
    sub table_name { 'ABC_TABLE' }
    
    1;
    
  3. or download this
    package NoTableName;
    
    ...
    with 'Foo';
    
    1;
    
  4. or download this
    use strict;
    use warnings;
    ...
    
    my $obj = Abc->new(name => 'Steve');
    printf "My name is %s\n", $obj->name; 
    
  5. or download this
    C:\Users\arun>perl abc.t
    My name is Steve
    
  6. or download this
    use strict;
    use warnings;
    ...
    
    my $obj = NoTableName->new(name => 'Bob');
    printf "My name is %s\n", $obj->name; 
    
  7. or download this
    C:\Users\arun>perl -c notablename.t
    'Foo' requires the method 'table_name' to be implemented by 'NoTableNa
    +me' at C:/Perl/site/lib/Moose/Meta/Role/Application.pm line 59
    ...
        eval {...} called at NoTableName.pm line 0
    Compilation failed in require at notablename.t line 3.
    BEGIN failed--compilation aborted at notablename.t line 3.
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (2)
As of 2020-04-06 00:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (36 votes). Check out past polls.

    Notices?