Public Scratchpad | Download, Select Code To D/L |
Most painful lesson learnt:
Allocation and assignment don't always happen together in a 'my' statement. Subroutine scratchpads can persist and hold on to old values.
my $var = 'value' if $condition; # this can biteThis is better written as:
my $var = $condition ? 'value' : undef; # assignment always happens