1overloading(3pm) Perl Programmers Reference Guide overloading(3pm)
2
3
4
6 overloading - perl pragma to lexically control overloading
7
9 {
10 no overloading;
11 my $str = "$object"; # doesn't call stringification overload
12 }
13
14 # it's lexical, so this stringifies:
15 warn "$object";
16
17 # it can be enabled per op
18 no overloading qw("");
19 warn "$object";
20
21 # and also reenabled
22 use overloading;
23
25 This pragma allows you to lexically disable or enable overloading.
26
27 "no overloading"
28 Disables overloading entirely in the current lexical scope.
29
30 "no overloading @ops"
31 Disables only specific overloads in the current lexical scope.
32
33 "use overloading"
34 Reenables overloading in the current lexical scope.
35
36 "use overloading @ops"
37 Reenables overloading only for specific ops in the current
38 lexical scope.
39
40
41
42perl v5.38.2 2023-11-30 overloading(3pm)