in reply to Unsuccessful and Uninitialized Value
Here's how I'd do it:
#!/usr/bin/perl use warnings; use strict; my $largestsize = 0; my $size; my $file = "filelist"; open (FILE, "$file") or die $!; while (<FILE>) { chomp; if ( -e $_ ) { $size = (stat($_))[7]; if ($size > $largestsize) { $largestsize = $size; } } } print ("$largestsize \n");
|
|---|