Lines Matching refs:overload
9 use overload (
118 eval q[ package Oscalar; use overload ('++' => sub { $ {$_[0]}++;$_[0] } ) ];
145 eval q[package Oscalar; use overload ('++' => sub { $ {$_[0]} += 2; $_[0] } ) ];
180 eval q[ package Oscalar; use overload ('=' => sub {$main::copies++;
226 eval q[package Oscalar; use overload ('+=' => sub {$ {$_[0]} += 3*$_[1];
263 use overload ('x' => sub {new Oscalar ( $_[2] ? "_.$_[1]._" x $ {$_[0]}
271 use overload ('.' => sub {new Oscalar ( $_[2] ?
293 eval "package Oscalar; no overload '.'";
313 eval "package Oscalar; sub comple; use overload '~' => 'comple'";
338 eval "package Oscalar; sub rshft; use overload '>>' => 'rshft'";
353 # warn overload::Method($a, '0+'), "\n";
354 test (overload::Method($a, '0+') eq \&Oscalar::numify); # 106
355 test (overload::Method($aI,'0+') eq \&Oscalar::numify); # 107
356 test (overload::Overloaded($aI)); # 108
357 test (!overload::Overloaded('overload')); # 109
359 test (! defined overload::Method($aI, '<<')); # 110
360 test (! defined overload::Method($a, '<')); # 111
362 test (overload::StrVal($aI) =~ /^OscalarI=SCALAR\(0x[\da-fA-F]+\)$/); # 112
363 test (overload::StrVal(\$aI) eq "@{[\$aI]}"); # 113
370 eval "package OscalarI; use overload '<<' => 'lshft', '|' => 'lshft'";
382 BEGIN { $int = 7; overload::constant 'integer' => sub {$int++; shift}; }
392 overload::constant 'q' => sub {$q++; push @q, shift, ($_[1] || 'none'); shift},
412 BEGIN { overload::constant 'q' => sub {push @q1, shift, ($_[1] || 'none'); "_<" . (shift) . ">_"},
447 use overload nomethod => \&wrap, '""' => \&str, '0+' => \&num,
476 foreach my $op (split " ", $overload::ops{with_assign}) {
480 foreach my $op (split " ", "@overload::ops{ @bins }") {
483 foreach my $op (split " ", "@overload::ops{qw(unary func)}") {
571 use overload nomethod => \&wrap, '""' => \&str, '0+' => \&num, '=' => \&cpy;
597 foreach my $op (split " ", $overload::ops{with_assign}) {
601 foreach my $op (split " ", "@overload::ops{ @bins }") {
604 foreach my $op (split " ", "@overload::ops{qw(unary func)}") {
693 use overload '""' => \&str, '0+' => \&num, fallback => 1;
707 use overload 'cmp' => \∁
719 use overload '<>' => \&iter;
724 # XXX iterator overload not intended to work with CORE::GLOBAL?
744 use overload '%{}' => \&hderef, '&{}' => \&cderef,
822 use overload '%{}' => \&gethash, '@{}' => sub { ${shift()} };
871 use overload '%{}' => sub { ${shift()}->[1] },
924 use overload bool => sub { ${+shift} };
938 # check that overload isn't done twice by join
941 use overload '""' => sub { $c++ };
948 # check the Odd number of arguments for overload::constant warning
951 $x = eval ' overload::constant "integer" ; ' ;
953 use warnings 'overload' ;
954 $x = eval ' overload::constant "integer" ; ' ;
955 test($a =~ /^Odd number of arguments for overload::constant at/) ; # 211
962 $x = eval ' overload::constant "fred" => sub {} ; ' ;
964 use warnings 'overload' ;
965 $x = eval ' overload::constant "fred" => sub {} ; ' ;
973 $x = eval ' overload::constant "integer" => 1; ' ;
975 use warnings 'overload' ;
976 $x = eval ' overload::constant "integer" => 1; ' ;
983 use overload '""' => sub { 3+shift->[0] },
989 use overload '""' => sub { 5+shift->[0] },
995 use overload '""' => sub { 2+shift->[0] },
1016 use overload '""' => sub { shift },
1029 use overload
1058 use overload
1075 test("a$utfvar" eq "a".200.2.1); # 224 - overload via sv_2pv_flags
1079 # were to eval the overload code in the caller's namespace, the privatisation
1082 use overload '%{}' => sub { (caller(0))[0] eq 'Foo' ? $_[0] : die "zap" };
1095 print overload::StrVal(qr/a/) =~ /^Regexp=SCALAR\(0x[0-9a-f]+\)$/ ? "ok 228\n" : "not ok 228\n";
1099 use overload '=' => sub { 42 },
1115 use overload (qw(0+ numify fallback 1));