Question:

All three ways of calling new() are equivalent in the code below

package A;

sub new {
    my ($class, $param) = @_;
    return bless {param => $param}, $class;
}


package main;

my $a1 = A->new('foo');
my $a2 = new A('foo');
my $a3 = A::new('A', 'foo');

Answers:


Keywords:

© 2017 QuizBucket.org