person01.pl to HTML.

index -|- end

Generated: Tue Feb 2 17:54:53 2010 from person01.pl 2008/10/11 576.

# 11/10/2008 - testing using class - object oriented stuff
use strict;
use warnings;
use Person; # see Person.pm
my ($him,@All_Recs);
$him = Person->new();   # constructor
$him->name("Jason");    # set 'name'
$him->age(23);          # 'age'
$him->peers( "Norbert", "Rhys", "Phineas" );    # and 'peers'
push @All_Recs, $him;  # save object in array for later
printf "%s is %d years old.\n", $him->name, $him->age;  # access name and age
print "His peers are: ", join(", ", $him->peers), "\n"; # show peers
printf "Last rec's name is %s\n", $All_Recs[-1]->name;

index -|- top

checked by tidy  Valid HTML 4.01 Transitional