Help for this page

Select Code to Download


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