rpaskudniak has asked for the wisdom of the Perl Monks concerning the following question:
Greetings, oh Great Ones!
Here is a sort command that is barfing on me:
This is greeted with a barrage of this error message:my @ptn_sortd = sort { ${$partition_h{a}}{full_tabname} cmp ${$partition_h{b}}{full_tabname}} @parnums;
Use of uninitialized value in string comparison (cmp) at ./<script nam +e> line 156. at ./<script name> line 156. Use of uninitialized value in string comparison (cmp) at ./<script nam +e> line 156. at ./<script name>l line 156. Use of uninitialized value in string comparison (cmp) at ./<script nam +e> line 156. at ./<script name> line 156. ....
I have already proven that no item in the hash has an undefined {full_tabname} member. I used
grep {defined(${$partition_h{$_}}{full_tabname}) }
to weed out the one such holdout. (That undefined name is separate mystery, out of scope for this question.) I have also confirmed that when I supply an actual value, the syntax does indeed return a string.
By the way, the hash keys are large-ish integers.What could I possibly be doing wrong to deserve this frustrating punishment?
Thanks much for help here! -- RP
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Debug a sort block
by AnomalousMonk (Archbishop) on Jan 31, 2020 at 20:05 UTC | |
by LanX (Saint) on Jan 31, 2020 at 21:41 UTC | |
|
Re: Debug a sort block
by LanX (Saint) on Jan 31, 2020 at 21:22 UTC | |
|
Re: Debug a sort block
by karlgoethebier (Abbot) on Feb 01, 2020 at 14:37 UTC |