macrobat has asked for the wisdom of the Perl Monks concerning the following question:
But when I run it, I get this error: Undefined subroutine &main::sort_len called at foo.pl line 10. I've also changed the make_sort() call to this:#!/usr/bin/perl # foo.pl - This is just a test use strict; use warnings; use Sort::Maker; make_sorter( name => 'sort_len', code => sub { length }, ST => 1 ); my ( $foo, $bar ) = (qw/very_long short/); my @order = sort_len( $foo, $bar ); print @order;
--but then I get the message "No sort made". Anyone have any ideas why that should be? The code passes syntax checking, and the module installed without errors. Oddness.my $sf = make_sorter( name => 'sort_len', code => sub { length }, ST = +> 1 ); die "No sort made\n" if (! $sf);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sort::Maker not making sort
by Corion (Patriarch) on Apr 18, 2007 at 20:44 UTC | |
by macrobat (Beadle) on Apr 20, 2007 at 19:53 UTC | |
|
Re: Sort::Maker not making sort
by polettix (Vicar) on Apr 18, 2007 at 22:16 UTC | |
by salva (Canon) on Apr 19, 2007 at 11:18 UTC | |
|
Re: Sort::Maker not making sort
by thezip (Vicar) on Apr 18, 2007 at 20:56 UTC |