File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -104,6 +104,24 @@ The number of elements of the set.
104
104
The total of all the values of the C < QuantHash > object. For a C < Setty >
105
105
object, this is just the number of elements.
106
106
107
+ = head2 method default
108
+
109
+ Defined as:
110
+
111
+ method default returns False
112
+
113
+ Returns the default value of the invocant, i.e. the value which is returned
114
+ when trying to access an element in the C < Setty > object which has not been
115
+ previously initialized or when accessing an element which has explicitly
116
+ been set to C < Nil > or C < False > .
117
+
118
+ my $s1 = SetHash.new(1, 2, 3);
119
+ say $s1{2}; # True
120
+ $s1{2} = Nil;
121
+ say $s1{2}; # False
122
+ # access non initialized element
123
+ say $s1{4}; # False
124
+
107
125
= head2 method ACCEPTS
108
126
109
127
method ACCEPTS($other)
You can’t perform that action at this time.
0 commit comments