Maybe this will help. I took the approach that it doesn't matter what the "cypher pattern" is as long as it's the same for both, but I'm probably missing something.
sub e{$a=$_;eval"\$a=~y/\Q$_\E/\0-~/";$a}
sub c{
($_,$m,$n,$a,$d)=@_;
map{$x=e;
$_,[grep{e eq$x}@$d]
}/\b[^ ]{$m,$n}\b/g
}
107 chars w/o the linebreaks and indentation.
update: changed \S to
[^ ] (as per chipmunk) to match tabs and newlines in encoded strings: 109 chars.
(but note that using
$_[0..4] would get back a couple of chars.)
Actually, the really correct way to do it seems to be something along the lines of:
map{$x=e;$_,[grep{e eq$x}@{$_[4]}]}
" $_[0] "=~/ ([^ ]{$_[1],$_[2]})(?= )/g
which makes it 115 chars.
update2: Same length but more straightforward:
map{$x=e;$_,[grep{e eq$x}@{$_[4]}]}
grep{/^.{$_[2],$_[3]}$/s}$_[0]=~/[^ ]+/g
Well it would be the same length: 
`grep/.../,' parses, but 
`grep/.../s,' doesn't seem to.
Oh, and this last has the args ordered right. As to how I got it "working with the parameter errors"; simple, I was calling it with the args in the wrong order.
 
p
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.