Hi, Perl Folks I am getting error "Too many arguments for OneTickUtil::getFilesFromDir at G:\workspace1\scripts\fooPackage.pl line 4, near "$pattern)" when running a small script calling a package routine. Could you give some ideas on what I did wrong?
Thanks, db # OneTickUtil.pm use File::Find; use Date::Calc qw(:all); use File::Path; ############################################################## # OneTickUtil # # Some classes and functions to use in omd examples ############################################################## package OneTickUtil; our $Dir; our $searchPattern; sub getFilesFromDir() { ($Dir, $searchPatter) = @_; @fileArrays = (); find(\&filter, $dirPattern); return @fileArrays; } sub filter { my $pathFile = $Dir . '\\' . $_; if (($pathFile =~ m/$searchPattern/i) && (-f $pathFile)) { push(@CSVFiles, $pathFile); } } 1; # foolPackage.pl use OneTickUtil; my $dir='F:\\omd\\Win32_REUTERS_IDN_SELECTFEED_Collector\ \one_market_data\\one_tick\\lib'; my $pattern='omd*'; my @files = OneTickUtil::getFilesFromDir($dir, $pattern); # error happens foreach my $file (@files) { print $file . "\n"; } -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/