My Perl Quiz

The ultimate place for testing what you have learned



Home | Start Quiz | List of questions  | Next Question | Login / Register

Question #14: All three ways of calling new() are equivalent in the code below
75% on 327 times asked

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');

true
false
© 2007-2010, My Perl Quiz, All rights reserved.
Can you find a bug in the quiz? Can you think of a new question that would be cool to add to this site? Email us and we will take action:
email us
Other Quizes | Contributors