in reply to ptkdb: 'my' variable in sub retains value between calls
my $a,$b; doesn't declare $b, only $a. Had you included
use strict; use warnings;
at the start of the program (see strict and warnings), perl would have told you "Parentheses missing around "my" list ...". The correct way is my ($a, $b);. But, $a and $b aren't good names to use as they are somewhat magical for their use with sort. You should choose more meaningful names.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: ptkdb: 'my' variable in sub retains value between calls
by leonidlm (Pilgrim) on Aug 10, 2008 at 16:11 UTC | |
by GrandFather (Saint) on Aug 10, 2008 at 22:53 UTC | |
by Anonymous Monk on Aug 11, 2008 at 02:16 UTC |