On Fri, Sep 25, 2009 at 8:21 AM, Zefram <perlbug-followup@perl.org> wrote:
> # New Ticket Created by Zefram
> # Please include the string: [perl #69384]
> # in the subject line of all future correspondence about this issue.
> # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=69384 >
>
> Can also work around it by side-effect numerification:
>
> $ perl -lwe 'sub my_cmp { my $r = $_[0] < $_[1] ? "-1" : $_[0] == $_[1] ?
> "0" : "1"; { no warnings "void"; 0+$r; } return $r; } print sort {
> my_cmp($a, $b) } (1,5,4,7,2)'
> 12457
>
Wouldn't
{ no warnings "void"; 0+$r; } return $r;
be simpler as
return 0+$r;
Thread Previous
|
Thread Next