On 1/3/24, G. Branden Robinson <g.branden.robin...@gmail.com> wrote:
> +{
> +  my ($v, $d, $f) = File::Spec->splitpath($prog);
> +  $prog = $f;
> +}

Since $v and $d are being discarded anyway, perl doesn't require you
to create dummy variables for them.
(http://perldoc.perl.org/perlfunc#my-VARLIST)  You can say:

   my (undef, undef, $f) = File::Spec->splitpath($prog);

Although it doesn't matter much in this case, since the scope of these
variables is so small, the undef version more clearly documents to
human readers that the first two values returned by splitpath() are
being discarded.

Reply via email to