in reply to Re: Re: recursive directory question
in thread recursive directory question
That's missing the final newline (a common mistake). Perhaps you wanted:open RESULTS, "> $results_file" or die "Failed to open $results_file for writing\n"; print RESULTS join("\n", @results); close RESULTS;
And as for:open RESULTS, ">$results_file" or die; print RESULTS "$_\n" for @results; close RESULTS;
I'd recast that as:$access{$_}{old} ||= 0; # defaults to avoid warnings $access{$_}{new} ||= 0; if ($access{$_}{old} > $access{$_}{new}) { push @results, "$_"; # keep results rather than pri +nting }
mostly because I hate changing values when all I'm really trying to do is test them. One of the many reasons why I'm not religious about enabling -w.if (($access{$_}{old} || 0) > ($access{$_}{new} || 0)) { push @results, "$_"; # keep results rather than pri +nting }
-- Randal L. Schwartz, Perl hacker
|
|---|