Help for this page

Select Code to Download


  1. or download this
    package SomeClass;
    use overload '""'=>"name";
    ...
        return $self->{NAME};
    }
    1;
    
  2. or download this
    use lib '.';
    use SomeClass;
    ...
    print "Explicit: my name is ", $thing->name, "\n";
    print "Implicit: my name is $thing\n";
    exit;
    
  3. or download this
    sub stringify {
        my $self = shift;
        return $self->{NAME};
    }