Help for this page

Select Code to Download


  1. or download this
    # object constructor
    sub new {
    ...
       $surname   { id $self } = shift;
       $self
    }
    
  2. or download this
    #!/usr/bin/perl
    
    package My::Person;
    ...
    
    my $person = My::Person->new( 'neil', 'watson' );
    print 'Name is ', $person->given_name();