tomcat said:
ech... it is
There is no problem with undefined subroutine anymore but there is new
one...
"Can't use string ("D:\mp3") as a HASH ref while "strict refs" in use
at D:/Perl/site/lib/File/Recurse.pm line 36"
What is the call that produces the error message? How are we supposed
to tell you what you do wrong when you don't say what you are doing?
D:\mp3 is path in script:
"$Dir_Path = "D:\\mp3";"
Line 36 in MODULE is there:
"sub Recurse {
my $dirsref = shift || die 'Recurse: Need an array reference of
dirs';
my $rulesref = shift;
%files = (); # -- reset the global variable
# -- Set the rules to a hash that &wanted can access
%File::Recurse::RULES = %{ $rulesref }; ############# LINE
36 ###
# -- Process it all
finddepth(\&File::Recurse::wanted, @{ $dirsref });
return %files;
}"
Any ideas?
Yes. Read the documentation for the module you are using!
In your original posting, the call was
Recurse(\&Test_And_Delete, $Dir_Path);
A glance at "perldoc File::Recurse" shows that the call is supposed
to be
Recurse(\@dirs, \%rules);
You are giving it a subref where it expects an arrayref, and a scalar
where it expects a hashref. That won't work.
Anno