Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Pure Virtual Functions

by Arunbear (Prior)
on Feb 07, 2009 at 19:27 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://742160]
help
Chatterbox?
and the web crawler heard nothing...

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

    No recent polls found