- or download this
my $class = ref($class) || $class;
- or download this
my $foo = Foo->new();
my $foo2 = $foo->new();
my $foo3 = Foo::new();
- or download this
+------+-------+-------+
| true | false | final |
...
+------+-------+-------+
| 1 | x | 1 | $foo->new()
+------+-------+-------+
- or download this
package Foo;
sub new {
...
my $foo = Foo::new();
print $foo;
$foo->test();
- or download this
main=HASH(0x180035c)
- or download this
Can't locate object method "test" via package "main" at test.pl line 1
+4.
- or download this
eval { Foo::new() };
ok(!$@, "Foo::new dies when called as a function");