Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
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 meditating upon the Monastery: (5)
As of 2015-07-07 05:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (87 votes), past polls