develooper Front page | perl.perl5.porters | Postings from August 2019

[perl #134312] wrong line number reported for sort subroutine?(Argument "a" isn't numeric in numeric comparison (<=>) at ... line ...)

Thread Previous
From:
Tony Cook via RT
Date:
August 6, 2019 06:16
Subject:
[perl #134312] wrong line number reported for sort subroutine?(Argument "a" isn't numeric in numeric comparison (<=>) at ... line ...)
Message ID:
rt-4.0.24-9652-1565072215-1685.134312-15-0@perl.org
On Thu, 25 Jul 2019 01:20:48 -0700, Ulrich.Windl@rz.uni-regensburg.de wrote:
> Hi!
> 
> I think this is a bug in perl 5.18.2 (as shipped in SLES12 SP4):
> 
> Debugging a sort routine I wrote myself I get an error that I don't
> understand, most likely because the line number reported (maybe even
> the whole error message) is wrong:

Could your sort comparison block be returning "" ?

$ perl5.18.3 -wle 'my @x = sort { "" } qw(1 2 3)'
Argument "" isn't numeric in sort at -e line 1.

Tony

---
via perlbug:  queue: perl5 status: new
https://rt.perl.org/Ticket/Display.html?id=134312

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About