http://qs321.pair.com?node_id=211161


in reply to [perlre/perlgolf] Golf this: return -1 or return +1 on regexp subroutine please

sub by_priority { (grep$_,map-($a=~/$_/)||$b=~/$_/,qw(ORGANIZATION SERVICE FAQ))[0] or$a cmp$b }

  p
  • Comment on Re: [perlre/perlgolf] Golf this: return -1 or return +1 on regexp subroutine please
  • Download Code