- or download this
use strict;
use warnings;
...
Foo->display(a => 400, b=>800);
Foo::display(a => 400, b=>800);
Foo::display(a => 400, b=>800, 900);
- or download this
object method called with
+
a = 400
...
b = 800
missing key/value (a 400 b 800 900) at /Users/adrianh/Desktop/foo.pl l
+ine 35
- or download this
ref($_[0])
and
...
||
( caller(0) )[0] eq __PACKAGE__
)
- or download this
use vars qw( $VERSION @ISA @EXPORT_OK %EXPORT_TAGS );
use Exporter;
...
@ISA = qw( Exporter );
@EXPORT_OK = qw( shave_opts coerce_array OOorNO myargs myself );
%EXPORT_TAGS = ( 'all' => [@EXPORT_OK] );
- or download this
use base qw(Exporter);
our $VERSION = 0.01_0;
our @EXPORT_OK = qw( shave_opts coerce_array OOorNO myargs myself );
our %EXPORT_TAGS = ( 'all' => [@EXPORT_OK] );
- or download this
# --------------------------------------------------------
# Constructor
# --------------------------------------------------------
sub new { bless( {}, shift (@_) ) }
- or download this
# --------------------------------------------------------
# Class::OOorNO::Class::OOorNO()
...
if defined( $_[0] )
and UNIVERSAL::can( $_[0], 'can' );
}
- or download this
sub DESTROY { }
sub AUTOLOAD { }
- or download this
use strict;
use warnings;
...
isa_ok $o, 'Class::OOorNO';
dies_ok {$o->this_method_does_not_exist} 'unknown method dies';
- or download this
ok 1 - use Class::OOorNO;
ok 2 - The object isa Class::OOorNO
+
not ok 3 - unknown method dies
# Failed test (t/foo.t at line 13)
+
# Looks like you failed 1 tests of 3.
- or download this
ok 1 - use Class::OOorNO;
ok 2 - The object isa Class::OOorNO
ok 3 - unknown method dies
ok
- or download this
sub OOorNO {
return ( $_[0] )
if defined( $_[0] )
and UNIVERSAL::can( $_[0], 'can' );
}
- or download this
sub OOorNO {
return $_[0] if UNIVERSAL::can( $_[0], 'can' );
}
- or download this
sub OOorNO {
UNIVERSAL::can( $_[0], 'can' );
}
- or download this
sub new { bless({ }, shift(@_)) }
- or download this
sub new { bless {}, shift }