Help for this page

Select Code to Download


  1. or download this
    use person;
    
    ...
    $foo->name("Stefan");
    $foo->age(20);
    $foo->exclaim();
    
  2. or download this
    $bar = Person->new();
    $bar->name("Yoda");
    $bar->age(900);
    $bar->exclaim();
    
  3. or download this
    $foo->name("Stefan");
    
  4. or download this
    Person::name( $foo , "Stefan” );
    
  5. or download this
    my $ref1 = { “name” => “Stefan”,
               “age” => 20 };
    my $ref2 = { “name” => “Yoda”,
               “age” => 900 };
    
  6. or download this
    $ref1 = bless $ref1 “Person”;
    $ref2 = bless $ref2 “Person”;
    
  7. or download this
    package Person;
    require 5.004;
    ...
    }
    
    return 1;
    
  8. or download this
    #!/usr/bin/perl
    
    ...
    
    # See, it's still here
    $foo->exclaim();
    
  9. or download this
    my $foo->new( “Stephan”, 20 );
    $foo->exclaim();
    my $bar->new( “Yoda”, 900 );
    $bar->exclaim();