In this code when there is only one file found it works with no errors and gives me the output I expect. However, when there is more than one file found I get this output. Any help is always appreciated!

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;

In reply to File::Find::Closures... help by mikejones

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.