11 require overload::numbers;
13 map { exists $overload::numbers::names{"($_"}
14 ? $overload::numbers::names{"($_"}
15 : Carp::croak("'$_' is not a valid overload")
20 my ( $class, @ops ) = @_;
23 if ( $^H{overloading} ) {
24 vec($^H{overloading} , $_, 1) = 0 for _ops_to_nums(@ops);
27 if ( $^H{overloading} !~ /[^\0]/ ) {
28 delete $^H{overloading};
32 delete $^H{overloading};
38 my ( $class, @ops ) = @_;
40 if ( exists $^H{overloading} or not $^H & 0x01000000 ) {
42 vec($^H{overloading} ||= '', $_, 1) = 1 for _ops_to_nums(@ops);
44 delete $^H{overloading};
56 overloading - perl pragma to lexically control overloading
62 my $str = "$object"; # doesn't call stringification overload
65 # it's lexical, so this stringifies:
68 # it can be enabled per op
69 no overloading qw("");
77 This pragma allows you to lexically disable or enable overloading.
81 =item C<no overloading>
83 Disables overloading entirely in the current lexical scope.
85 =item C<no overloading @ops>
87 Disables only specific overloads in the current lexical scope.
89 =item C<use overloading>
91 Reenables overloading in the current lexical scope.
93 =item C<use overloading @ops>
95 Reenables overloading only for specific ops in the current lexical scope.