--- David Gilden <[EMAIL PROTECTED]> wrote:
> Good day,
>
> keys look like: Dowda_23241506142001
>
> This is wrong, but not sure how the syntax is,
>
> Where are $a,$b coming from, I thought of a sub, but how do assign
> $a, $b
$a and $b are automagically assigned values. LEAVE THEM ALONE! =o)
(At least, don't write to them.)
> foreach my $key (sort { /_(\d+)$/; $a <=> $b } (keys %subjects)) {
> # /_(\d+)$/ grabs the number at the end of the string,
Try this:
for my $key (sort { my($A) = $a =~ /_(\d+)$/;
my($B) = $b =~ /_(\d+)$/;
$A <=> $B } keys %subjects) {
# code ...
}
__________________________________________________
Do You Yahoo!?
Spot the hottest trends in music, movies, and more.
http://buzz.yahoo.com/