RE: sort function?

2004-03-25 Thread Bob Showalter
Radhika Sambamurti wrote: > Hi, > I have written a small script that is supposed to tell me the oldest > file in my directory (as per ctime). I have read the various times > the various files were created, into an array called times. I have > then sorted this array - @sorted_times. when i do ls -l

Re: sort function?

2004-03-25 Thread Flemming Greve Skovengaard
Use this: __BEGIN__ use strict; use warnings; die "No file name supplied.\n" unless @ARGV; my $oldest_name = shift @ARGV; my $oldest_age = -C $oldest_name; foreach (@ARGV) { my $age = -C; ($oldest_name, $oldest_age) = ($_, $age) if ($age > $oldest_age); } printf "The oldes

RE: sort function?

2004-03-24 Thread Charles K. Clarkson
Radhika Sambamurti <[EMAIL PROTECTED]> wrote: : : my question is - where did the very first line from my : output come from? ie Mon Mar 15 15:55:58. As you can see, : ls -l does not show any file created at that time. Even : . and .. are not the above time. : Is it using sort(@array), that sorts i

sort function?

2004-03-24 Thread Radhika Sambamurti
Hi, I have written a small script that is supposed to tell me the oldest file in my directory (as per ctime). I have read the various times the various files were created, into an array called times. I have then sorted this array - @sorted_times. when i do ls -l i get the following: wxrwxr-x 1