in reply to reg expression

sort(@curr);
This doesn't leave @curr sorted; sort just returns the sorted list. You want:
@curr = sort(@curr);
and presumably you want it after the for loop, not inside the loop.

Replies are listed 'Best First'.
Re^2: reg expression
by graff (Chancellor) on Jun 15, 2006 at 03:46 UTC
    Actually, this would make more sense for the OP:
    print sort @curr;
    Nevermind. sorry.