Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: CGI::Buildform

by Brovnik (Hermit)
on Aug 30, 2001 at 14:36 UTC ( [id://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

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2024-04-25 14:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found