Pathologically Eclectic Rubbish Lister | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
Looking at the source code of Sort::Maker makes my eyes bleed, but it also seems that Sort::Maker uses a weird way of communicating errors - it sets $@ but doesn't die. So you could maybe change your error checking as follows:
When I do that with your code, I get the following "error":
which I consider to be fatal instead of to be the kind of warning people would prefer to hide. Also code is documented to be valid - maybe it depends on the order of arguments, as Sort::Maker really employs some nonstandard argument parsing. Maybe this also is another Perl "Best Practice" that is more a TheDamian Best Practice and should be avoided in general use. Reading the documentation some more, it seems you have to give it some more arguments for sorting strings and/or numbers. The following code works for me:
Here I've wrapped the code => sub { length } in string => {...} - you should read the documentation if that is what you need or not, while I wash my eyes from looking at the code, the interface and the documentation. In reply to Re: Sort::Maker not making sort
by Corion
|
|