Would someone kindly advise me in sorting this array:

my @array = qw(c r v vr tr re c.p[1] c.p[3] c.p[2] c.p[4] c.p[7]
c.p[6] c.p[5] c.p[8] c.t[1] c.t[3] c.t[2]);

I only want to sort the elements that have a numeric value inside the
braces so that all the other elements have their original index
preserved.

Sample output I am trying to accomplish:

c
r
v
vr
tr
re
c.p[1]
c.p[2]
c.p[3]
c.p[4]
c.p[5]
c.p[6]
c.p[7]
c.p[8]
c.t[1]
c.t[2]
c.t[3]

Is this a good example to use Schwartzian Transform?

Thanks in advance,

Chris

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to