mikejones has asked for the wisdom of the Perl Monks concerning the following question:
Please enter filesystem name in the form of '/fsname' /cygdrive/c/temp Use of uninitialized value in concatenation (.) or string at file_find +.plx line 24, <> line 1. Use of uninitialized value in concatenation (.) or string at file_find +.plx line 24, <> line 1. Use of uninitialized value in numeric comparison (<=>) at file_find.pl +x line 24, <> line 1. Use of uninitialized value in numeric comparison (<=>) at file_find.pl +x line 24, <> line 1. FileSize in Bytes FileNames over 25 Mbytes =================================================================== 33502125: /cygdrive/c/temp/Setup/Pattern/Share/0x0000000 +4/Copy of lpt$vpn.701 =========================================================== 33502125: /cygdrive/c/temp/Setup/Pattern/Share/0x0000000 +4/lpt$vpn.701
#!/usr/bin/perl use strict; use warnings; use Readonly; use File::Find; use File::Find::Closures qw(:all); #use Data::Dumper; my (@sorted_large_files,@large_files); print qq (\nPlease enter filesystem name in the form of '/fsname'\n); my $fs = <>; chomp ($fs); my @directory = qq($fs); Readonly::Scalar my $t25Mb => 26500000; my( $wanted, $list ) = find_by_min_size ( qq($t25Mb) ); File::Find::find ( { wanted => $wanted, }, @directory ); @large_files = $list->(); @sorted_large_files = sort { -s "$_/$b" <=> -s "$_/$a" } @large_files; print "\nFileSize in Bytes\tFileNames over 25 Mbytes\n"; print map { '=' x length $_,"\n", -s $_,":\t\t$_\n" } @sorted_large_files;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: File::Find::Closures... help
by Corion (Patriarch) on Dec 15, 2007 at 22:33 UTC | |
by mikejones (Scribe) on Dec 15, 2007 at 23:40 UTC | |
|
Re: File::Find::Closures... help
by CountZero (Bishop) on Dec 15, 2007 at 23:09 UTC | |
|
Re: File::Find::Closures... help
by poolpi (Hermit) on Dec 16, 2007 at 12:46 UTC | |
by mikejones (Scribe) on Dec 20, 2007 at 23:25 UTC |