Re: tpm2deb-bin.pl: minor Perl issues
Frank Küster <frank@debian.org> wrote:
> 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";
Not that I understand anything about Perl, but using system() exposes
you to problems with argument quoting (spaces, dollar signs, etc.). And
it launches a shell for nothing useful unless you rely on globbing or
something like that (the tiny "waste of resources" is probably
irrelevant here, though).
--
Florent
Reply to: