Help for this page

Select Code to Download


  1. or download this
    {
        package Person;
    ...
    
    my $alice = Person->new(name => 'Alice', age => 32);
    $alice->introduce_yourself;
    
  2. or download this
    my $alice = Person->new(name => 'Alice', age => 32);
    my $bob   = Person->new(name => 'Bob', age => 31);
    
    $_->introduce_yourself for $alice, $bob;
    
  3. or download this
    {
        package Person;
    ...
    $alice->bear_children($bob, 'Carol', 'Dave', 'Eve');
    
    print "Bob is a father!\n" if $bob->is_parent;
    
  4. or download this
    use Moops;
    
    ...
    $alice->bear_children($bob, 'Carol', 'Dave', 'Eve');
    
    say "Bob is a father!" if $bob->is_parent;