"'gt' refers to the size of the string"
No. In your code, gt looks at "dictionary sequence".
If string size/length is what you wanted, say length($str) expliciltly.
use Data::Dumper; my @foo = ("abc", "bc"); print Dumper(sort bar1 @foo); print Dumper(sort bar2 @foo); sub bar1 { return $a gt $b; } sub bar2 { return length($a) gt length($b); }
In reply to Re^3: intermix list of items
by pg
in thread intermix list of items
by tstock
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |