bakunin has asked for the wisdom of the Perl Monks concerning the following question:
package Foo::Button; use strict; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw (newButton); ## short hand method that feeds some initial data to ## the constructor new() sub newButton { __PACKAGE__->new( {Up=>shift} ); } ## Class call only sub new { my $class = shift; my $self = {}; bless $self,$class; $self->{shape} = shift; ## fill up some other fields, then return $self; } 1; ## in file test.pl package main; use Foo::Button; my $b = newButton(@args);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: Foo::Button->new vs. newButton()
by merlyn (Sage) on Jan 16, 2004 at 19:10 UTC | |
|
Re: Foo::Button->new vs. newButton()
by stvn (Monsignor) on Jan 16, 2004 at 19:28 UTC | |
by bakunin (Scribe) on Jan 16, 2004 at 19:52 UTC | |
by stvn (Monsignor) on Jan 16, 2004 at 19:58 UTC | |
by hhdave (Beadle) on Jan 16, 2004 at 20:21 UTC | |
|
Re: Foo::Button->new vs. newButton()
by hardburn (Abbot) on Jan 16, 2004 at 19:13 UTC | |
|
Re: Foo::Button->new vs. newButton()
by adrianh (Chancellor) on Jan 16, 2004 at 21:48 UTC | |
|
Re: Foo::Button->new vs. newButton()
by gmpassos (Priest) on Jan 16, 2004 at 23:19 UTC | |
|
Re: Foo::Button->new vs. newButton()
by CountZero (Bishop) on Jan 16, 2004 at 22:38 UTC | |
|
Re: Foo::Button->new vs. newButton()
by mvc (Scribe) on Jan 17, 2004 at 17:11 UTC |