That should be local our $check;. Let's not clobber our caller's variables.
sub getChecksum($) { my $in = shift; local our $check = 0; $in =~ m/(?:(.)(?{$check += ord($1);}))*^/; return $check;
In reply to Re^2: Weird behaviour with match-time code evaluation and backtracking
by ikegami
in thread Weird behaviour with match-time code evaluation and backtracking
by moensch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |