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