Hello Vincent,
* Vincent Lefevre wrote on Thu, Aug 07, 2008 at 03:16:29PM CEST:
> This is not really a bug, but this makes the code quite strange and
> probably not very maintainable. /usr/bin/autom4te contains:
>
> foreach my $file (map { $_ . $req->id } ($tcache, $ocache))
> {
> use File::Copy;
> move ("${file}t", "$file")
> or fatal "cannot rename ${file}t as $file: $!";
> }
>
> The "use File::Copy;" should be at the beginning of the script
> because it is global[*]
Is this just a code cleanliness issue? AIUI then 'use File::Copy;' at
the beginning of the script does the same thing as the use here. So
IMVHO it is very maintenance-friendly to put the statements together
with the code that needs it as that facilitates copy-and-pasting the
code around, for example. Of course, if that 'use' were not idempotent,
or if the module were used all over the map in the file, then it would
make more sense to put it at the beginning.
> (and is also there for the second "move" in the script).
Where would that be?
Thanks,
Ralf
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]