Subject: | Indirect method invocation instead of passing parameter |
When I use:
dircopy('/somepath', 'somedir/somefile')
I catch the following error:
Can't locate object method "pathrmdir" via package "somedir/somefile"
(perhaps you forgot to load "somedir/somefile"?) at /usr/lib/perl5/site_
perl/5.8.3/File/Copy/Recursive.pm line 126.
It's because of the line:
pathrmdir $_[1] or carp "\$RMTrgDir failed: $!";
Perl tries to indirectly call pathrmdir as a method of $_[1], i.e. $_[1]
->pathrmdir. In order for this code to work, it should look like this:
pathrmdir($_[1]) or carp "\$RMTrgDir failed: $!";
Please, fix it in CPAN so I can rely on the last version in a software
project I am working for. Thanks a lot!