#!/usr/bin/perl # HowToCreate.pl Daniel Brockman 070205 How to create an Object ################################################# # The author grants permission to use for any # # purpose, including copying and modification, # # provided the user acknowledges the author by # # name. (Creative Commons Attribution License # # http://creativecommons.org/licenses/by/2.5/ ) # # -- Daniel Brockman, author, 20070205 # ################################################# # # # Imho, the books "Programming Perl" and "Perl Cookbook" # almost tell you how to create and use an object, but # not quite. Here is an example of one way to create a # practical object to supplement these texts. BEGIN {@INC,(".",@INC)}; use strict; use Tpkg; # see accompanying package Tpkg.pm use Data::Dumper; my $x = Tpkg->new( alpha => "one", beta => "two", ); # XML manipulator $x->prtvals(); print Dumper($x); #-----------------------------------------------------------------