- or download this
#!/usr/bin/perl
use warnings; use strict;
...
}
- or download this
# Write a function to precompute all those boolean keys you want to
# sort by. This should be an improvement because now the code has
...
}
- or download this
# Depending on what my_sort does, you might also want to transform it
# in a similar way, to generate a key you can compare easily later,
...
}
- or download this
# Now do the sort relying on the key we computed. Note that as
# the compare function is still non-trivial, I don't write its
...
our @showtab_sorted = sort { show_compare($a, $b) } @showtab;
- or download this
# Print the results. I print the keys I've generated for
# debugging, you normally wouldn't print those.
...
};
__END__
- or download this
,-----------A !($s->{user} =~ /LadyAleena_($network_string|TV)/ && $s
+->{name} !~ /TV/),
...
1111111101 Utilities (LadyAleena_home)
1111111110 Followers' businesses (Lady_Aleena)
1111111110 List subscribers (Lady_Aleena)