in reply to Why is my code producing weird output?
My perl : This is perl 5, version 34, subversion 0 (v5.34.0) built for x86_64-linux-gnu-thread-multi$ perl pm1.pl < pm1-dat.txt george:2~~14 nick:5~~10~~20 peter:3
Your code uses an un-declared $a which is also used by sort.
Your perl seems to encounter side-effects of that.
I recommend you use a declared variable NOT named $a, or $b.
"These opinions are my own, though for a small fee they be yours too."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Why is my code producing weird output?
by hv (Prior) on Aug 30, 2023 at 23:31 UTC |