Greetings,
I posted this question on perlmonks and received some great help, specifically from mirod but his recent suggestion is still not working.
Problem: This code only works when I hard-code the size to
search for in the routine. I try to pass arguments using @_, but it
does not work. How do I pass $size_input so wanted sees and uses it?
Mirod's help:
You need to pass an additional parameter to wanted. The way to do this is to use a closure: File::Find::find({wanted => sub { wanted( $size_input); } }, $fs_input ) ;. This way wanted is called by the anonymous sub, and gets passed $size_input.
See Why I hate File::Find and how I (hope I) fixed it for more info.
I read the "why i hate...." two and three times and yet still cannot get it to work.
thank you in advance!
http://www.perlmonks.org/?node_id=687008
use strict;
use warnings;
use File::Find;
my ( @root_files, @large_files, %%mounts, @mounts, ) ;
use vars qw/*name *dir *prune/ ;
*name = *File::Find::name ;
*dir = *File::Find::dir ;
*prune = *File::Find::prune ;