note
Fletch
<p>
Your [doc://sort] call just reorders your list, it does nothing to "filter" the contents. You want to take the <strike>first</strike> last item off the generated list.
</p>
<p>
Also it doesn't make much sense to use <c>s///</c> to modify the string to M-D-Y to then return a different string Y-M-D. Better would be to either use just a match <c>m//</c> and return the new string, or to actually switch things around with the <c>s///</c> and return the modified string.
</p>
<c>
## Either
$mdy =~ m{^(...blahblah...)};
return "$3-$1-$2";
## Or . . .
$mdy =~ s{^(...blahblah...)}{$3-$1-$2};
return $mdy;
## Or maybe (with a new enough perl)
return $mdy =~ s{...}{$3-$1-$2}r;
</c>
<p>
<b>Edit:</b> Misread the order of comparison being used in the parent sample code.
</p>
<div class="pmsig"><div class="pmsig-58196">
<p>
The cake is a lie.<br />
The cake is a lie.<br />
The cake is a lie.<br />
</p>
</div></div>
11140571
11140574