#!/usr/bin/perl #********************************************************* # Example of the using a class/package # # adapted by Al Bento # # includes the package Person.pm, creates an instance of # an object, use the package data methods to assign # values to the instance of the object. #********************************************************* use Person; $her = Person->new(); $her->name("Ana"); $her->age(18); $her->peers( "Andrea", "Tony", "Cleo" ); # print the values of the instance printf "%s is %d years old.\n", $her->name, $her->age; print "Her peers are: ", join(", ", $her->peers), "\n";