Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Re^4: USE or Require?

by diotalevi (Canon)
on Jul 24, 2003 at 21:23 UTC ( [id://277695]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use l2kashe 'new';
    my $o = new;
    $o->foo( ... );
    ...
    use l2kashe;
    my $o = l2kashe->new;
    $o->foo( ... );
    
  2. or download this
    use l2kashe; # The importing new() dies
    sub new { ... } # This one stays
    # Vs
    sub new { ... } # The original new() dies
    use l2kashe; # This one overwrites
    
  3. or download this
    sub new { bless {}, shift }
    # Vs
    sub new { bless {}, __PACKAGE__}
    # or maybe even:
    sub new { bless {}, 'l2kashe' }
    
  4. or download this
    sub new {
        my $class_or_parameter = shift;
        if ( $class ne __PACKAGE__ ) {
    ...
        }
        bless { @_ }, __PACKAGE__;
    }
    
  5. or download this
    sub something {
        my $self_or_parameter = shift;
        if ( ref $self_or_parameter eq __PACKAGE__ ) {
    ...
        }
         ...
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://277695]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-03-28 16:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found