in reply to Re: Weird behaviour with match-time code evaluation and backtracking
in thread Weird behaviour with match-time code evaluation and backtracking
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;
|
|---|