Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Prototypes allow overloading subs?

by Ovid (Cardinal)
on Dec 04, 2002 at 20:52 UTC ( [id://217591]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my $person = People
        ->new
    ...
        ->email( 'dev@null.com' )
        ->save;
    my $id = $person->get_id;
    
  2. or download this
    my $person = People->new( $id );
    print $person->first_name, ' ', $person->last_name;
    
  3. or download this
    class People {
        // Java constructors have the same name as the class
    ...
            // we can now access an object by id
        }
    }
    
  4. or download this
    sub new {
        my ($class,$id) = @_;
    ...
        %data = $class->_initialize($id) if $id;
        bless \%data, $class;
    }
    
  5. or download this
      # no!  If this is mapping to a database, you probably don't
      # want them to be able to change the id
      $person->id( $id );
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2024-03-29 00:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found