77.

1 2 3 4 5 6 7 + 1234567890123456789012345678901234567890123456789012345678901234567890 +1234567 sub by_priority{my$r=qr/^(?:Service|Organisation|FAQ)/;($a=~$r&&-1)+($ +b=~$r)}

Update: As anon. below points out, I hadn't read the spec properly, so... for a less desireable 89 85 88. Instead of Sunset strip, thats two fat ladies.

# 1 2 3 4 5 6 +7 8 #234567890123456789012345678901234567890123456789012345678901234567890 +123456789012345678 sub by_priority{my$r=qr/^(?:Service|Organisation|FAQ)/;($a=~$r&&-1)+($ +b=~$r)||$a cmp$b;}

Test code and results (Hopefully I didn't try a step to far this time.)

#! perl -sw use strict; # 1 2 3 4 5 6 +7 8 #234567890123456789012345678901234567890123456789012345678901234567890 +12345678901234567 sub by_priority{my$r=qr/^(?:Service|Organisation|FAQ)/;($a=~$r&&-1)+($ +b=~$r)||$a cmp$b} my @stuff = qw/ the Services_s FAQ_A quick FAQ_C Organisation_3 brown FAQ_B fox Services_p jumps Services_q Over Organisation_1 A lazy Organisation_2 dog /; sub shufl (\@) { my $r=pop; $a = $_ + rand @{$r} - $_ and @$r[$_, $a] = @$r[$a, $_] for (0..$#{$r}); } shufl @stuff; print $_,$/ for sort by_priority @stuff; __END__ c:\test>test FAQ_A FAQ_B FAQ_C Organisation1 Organisation2 Organisation3 Servicesp Servicesq Servicess A Over brown dog fox jumps lazy quick the c:\test>

Nah! Your thinking of Simon Templar, originally played by Roger Moore and later by Ian Ogilvy

In reply to Re: [perlre/perlgolf] Golf: Sunset strip! by BrowserUk
in thread [perlre/perlgolf] Golf this: return -1 or return +1 on regexp subroutine please by princepawn

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.