sub by_priority { return -1 if $a =~ /^Organization/ ; return 1 if $b =~ /^Organization/ ; return -1 if $a =~ /^Service/ ; return 1 if $b =~ /^Service/ ; return -1 if $a =~ /^FAQ/ ; return 1 if $b =~ /^FAQ/ ; return 0 ; } @htmlfiles = sort by_priority @htmlfiles;
In reply to [perlre/perlgolf] Golf this: return -1 or return +1 on regexp subroutine please by princepawn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |