I have a directory of c source with names:
0.c , 1.c , 2.c, 3.c, 4.c, ..... 9.c, 10.c, 11.c
I do a glob on those files
and do a
foreach $file (@filelist)
print $file
I get the following which is not ordered:
0.c
1.c
10.c
11.c
2.c
3.c
4.c
5.c
..
..
9.c
Whereas I expect it to be
0.c
1.c
2.c
3.c
4.c
5.c
..
..
9.c
10.c
11.c
Can somebody help with the code for sorting it as above.
Thank you. Have a nice day.
0.c , 1.c , 2.c, 3.c, 4.c, ..... 9.c, 10.c, 11.c
I do a glob on those files
and do a
foreach $file (@filelist)
print $file
I get the following which is not ordered:
0.c
1.c
10.c
11.c
2.c
3.c
4.c
5.c
..
..
9.c
Whereas I expect it to be
0.c
1.c
2.c
3.c
4.c
5.c
..
..
9.c
10.c
11.c
Can somebody help with the code for sorting it as above.
Thank you. Have a nice day.