Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: CGI::Buildform

by Brovnik (Hermit)
on Aug 30, 2001 at 14:36 UTC ( #109038=note: print w/ replies, xml ) Need Help??


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


Comment on Re: CGI::Buildform
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://109038]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (8)
As of 2014-11-26 09:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (165 votes), past polls