http://qs321.pair.com?node_id=109038


in reply to CGI::Buildform

One brief comment - Always use the 2 argument form of bless,
bless($self,$class);
so that the class can be subclassed. You may need to check the $class, depending on how it is called, so
my $proto = shift; my $class = ref($proto) || $proto; # stuff to create self bless($self,$class);
is good practice. bless returns the item as well, so you could write your new() method as
sub new { my ($proto,$name,$type,$end) = @_; my $class = ref($proto) || $proto; return bless { name => $name, type => $type, end => $end, attributes => {}, }, $class; }

--
Brovnik