Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

[bold]FIle access times: printing name of stalest file [/bold]

Status
Not open for further replies.

jjohnn

Technical User
Feb 11, 2003
43
US
I want to print the name and age of the odest file entered on the command line:
Code:
my @oldest;
foreach (@ARGV){
		if (-A $_ > $oldest[1]){
			$oldest[1] = -A $_;
			$oldest[0] = "$_".",";
		}
print "@oldest ";
}[\code]

I expected only the oldest file (name and age) to print, but instead I get the names ann ages of all files entered on the command line
 
It takes postingin public to see my errors. I printed inside the for loop.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top