... as far as I am aware I cannot define side-effects for a subroutine in Perl....
It's easy:
use 5.010; sub square_a_number { my $value = shift; $Some::Global::Variable += $value; say "Squaring the value '$value'"; return $value * $value; }
There are two trivial side effects, as well as the non-obvious side-effect of setting SvNOK on $value.
In reply to Re^9: map in void context
by chromatic
in thread map in void context
by dharanivasan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |