– is a unary minus, which changes the sign of its operand. Because this operator silently calls the Numeric method, it can also cast the context, as it does the unary plus operator.
my Str $price = '4' ~ '2'; say -$price; # -42
Science, Programming, Electronics, Languages
N. B. Perl 6 has been renamed to Raku. Click to read more.
– is a unary minus, which changes the sign of its operand. Because this operator silently calls the Numeric method, it can also cast the context, as it does the unary plus operator.
my Str $price = '4' ~ '2'; say -$price; # -42