[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

tpm2deb-bin.pl: minor Perl issues



Hi Norbert, hi all,

1. tpm2deb-bin.pl frequently uses constructs like

	eval { mkpath($rundest) };
	if ($@) {
		die "Couldn't create dir: $@";
	}  

  In terms of readability, I would prefer

        system("mkdir -p $rundest") == 0
                or die "Couldn't create dir $rundest";

  Any reason not to make this change?

2. Why are constructs like this needed:

	my $newdest;
	my $foo="\$newdest = \"$dest\"";
	eval $foo;

   Why isn't it possible to just set my $newdest=$dest?  In some cases
   (e.g. do_remap_and_copy, first instance) it seems completely
   superfluous, since only $newdest is ever used; we could as well set
   $newdest from the pattern matching.

3. We go through great pain to change @INC early in a BEGIN block to get
   Tpm.pm and friends.  Why don't we just add /usr/share/tex-common to
   @INC? Tpm.pm and FileUtils.pm are already there.

4. in the do_remap_and_copy function, the config-link option differs
   from the others:

   - it does not remove leading texmf*/
   - it adds $newdest to @configfiles, not $newdest/$file.

   Is this intended?  

5. In &mycopy (and maybe at other places), does it make sense at all to
   discard stderr?  I think if the command spits out something, it's
   nearly always interesting.

Regards, Frank
-- 
Dr. Frank Küster
Single Molecule Spectroscopy, Protein Folding @ Inst. f. Biochemie, Univ. Zürich
Debian Developer (teTeX/TeXLive)



Reply to: