Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Remove bless reference or class/package name from method arguments

by binf-jw (Monk)
on May 20, 2009 at 10:04 UTC ( [id://765168]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package Object;
    {
    ...
    
    }
    1;
    
  2. or download this
    use Object
    Object::pow( 2, 2 );
    
  3. or download this
    use Object 'pow';
    pow( 2,2 );
    
  4. or download this
    Object->pow(2,2);
    
    ...
    $obj->pow(2,2);
    
    pow(2,2); # Exported or internal method call
    
  5. or download this
        sub rmvObjRef
        {
    ...
            return @_;
    
        }
    
  6. or download this
    shift if ref $_[0] eq __PACKAGE || $_[0] eq __PACKAGE__;
    
  7. or download this
    @_ = rmvObjRef( __PACKAGE__, @_ );
    
  8. or download this
    package NumObject;
    
    ...
       return NumObject + NumObject;
    
    }
    
  9. or download this
    my $num1 = NumObject->new();
    my $num2 = NumObject->new();
    NumObject::addObjects( $num1, $num2  );
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://765168]
Approved by citromatik
Front-paged by Arunbear
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-19 20:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found