macrobat has asked for the wisdom of the Perl Monks concerning the following question:
Folks,
Are there any particular invocations or environment variables that I need to get Sort::Maker to work?
I have this (mostly just copied from Perl Best Practices):
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);
Back to
Seekers of Perl Wisdom