in reply to Is "ref($class) || $class" a bad thing?
This function call passes nothing:
my $foo = Foo::new();What do you expect to be in $class in this code?
sub new { my ($class) = @_; $class = ref($class) || $class; return bless {}, $class; }
What do you expect to be in $class in this code?
sub new { my $class = shift; bless {}, $class; }
I don't see the connection.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Is "ref($class) || $class" a bad thing?
by kscaldef (Pilgrim) on Jul 12, 2004 at 17:19 UTC | |
|
Re^2: Is "ref($class) || $class" a bad thing?
by stvn (Monsignor) on Jul 12, 2004 at 17:24 UTC | |
by chromatic (Archbishop) on Jul 12, 2004 at 19:52 UTC | |
by stvn (Monsignor) on Jul 12, 2004 at 20:42 UTC | |
by chromatic (Archbishop) on Jul 12, 2004 at 21:20 UTC | |
by stvn (Monsignor) on Jul 12, 2004 at 22:29 UTC | |
| |
by eric256 (Parson) on Jul 12, 2004 at 20:03 UTC | |
by dragonchild (Archbishop) on Jul 12, 2004 at 20:09 UTC |