UPDATE

Mirod's idea does not retain my $size_input and I am still having to hard-code the value. Any more ideas greatly appreciated!

sub wanted; File::Find::find({wanted => sub { wanted( $size_input ); } }, $fs_inpu +t ) ;
UPDATE AGN

I changed the find code to include a dereference (->) and the value is being printed the line b4 the int -s, but now the array is not being populated with $name when it should contain 16 elements. Finally when I print *name with $size_input it does not print, but when I print *name with the hard-coded number in the int ((( -s line, I see *name incrementing.

File::Find::find({wanted => sub { wanted->( $size_input ); } }, $fs_i +nput ) ; <snip> else { my ( $size_input ) = shift @_ ; ###-- Freeze the arg --# my ($dev,$ino,$mode,$nlink,$uid,$gid); (( $dev,$ino,$mode,$nlink,$uid,$gid ) = lstat($_) ) && ( $dev >= 0 ) && !( $File::Find::prune |= ($dev != $File::Find::topdev ) ) && print "MIDDLE SZINPT:\t",($size_input),"\n", && ( int(((-s _) + 1023) / 1024 ) > $size_input ) && push ((@large_files), $name); } } ###-- End sub --### print scalar @large_files;

__OUTPUT__ MIDDLE SZINPT: 26214400 MIDDLE SZINPT: 26214400 MIDDLE SZINPT: 26214400 0

In reply to Re^2: passing argument to sub wanted by mikejones
in thread passing argument to sub wanted 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.