phathead22 has asked for the wisdom of the Perl Monks concerning the following question:
The error returned states "Use of uninitialized value" on the "@list = sort" line. Can you make some suggestions? I know that this object is dealing with passed variables ($path), and this seems to be OK; perhaps you could inform as to the expectations that PERL has? Thx PHsub GetInfDataFiles { my ($path) = @_; my ($currpath, $age, $filea, $fileb, @allfiles, @list); $currpath = cwd(); chdir $path; $age = -7; @allfiles = `find .. -name "r*" -type f -mtime $age`; chomp( @allfiles ); foreach (@allfiles) { chomp(); s/\.\///; } @list = sort { (-M "$path/$b") <=> (-M "$path/$a") } @allfiles; chdir $currpath; print ( "@list" ); return @list; } # GetInfDataFiles()
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Array error!
by Pug (Monk) on May 01, 2001 at 23:07 UTC | |
|
(boo)Re: Array error!
by boo_radley (Parson) on May 01, 2001 at 22:49 UTC | |
by ar0n (Priest) on May 02, 2001 at 10:40 UTC |