in reply to passing argument to sub wanted
There are two solutions.
Use a global variable.
my $size_input; sub wanted { ... $size_input ... } ... $size_input = ...; ... find({wanted => \&wanted}, $fs_input);
But using globals is undesirable.
Or have find call a function other than wanted, and have it called wanted with the parameter.
sub wanted { my ($size_input) = @_; ... $size_input ... } { my $size_input; ... $size_input = ...; ... find({wanted => sub { wanted($size_input) }}, $fs_input); }
|
|---|