in reply to Re: Re: Matching part of a path
in thread Matching part of a path
If the subroutine's prototype is ($$), the elements to be compared are passed by reference in @_, as for a normal subroutine. This is slower than unprototyped subroutines, where the elements to be compared are passed into the subroutine as the package global variables $a and $b (see example below). Note that in the latter case, it is usually counter-productive to declare $a and $b as lexicals.Perl only complains when you try to doubly declare a lexical variable name in the same scope. The following won't produce a complaint:
use strict; use warnings; my $foo; { my $foo; }
Makeshifts last the longest.
|
|---|