On Mon, Oct 01, 2001 at 12:46:21PM +0200, birgit kellner wrote:
> Yes, I actually don't really understand these calls. What do the braces do? 
> $regexp_func[$field] would be the array element number $field of 
> @regexp_func.

Yes.


> Do the braces ensure that the variable is interpolated, to the effect that
> the subroutine with the value of $regexp_func[$field] as its name is
> called?

Without the braces the call:

    &$regexp_func[$field]

would be equivalent to

    &func[$field]

which is a syntax error.

So, all the braces do is insure that $regexp_func[$field] is called as a
subroutine; $regexp_func[$field] can be a code reference (i.e. a hard
reference), or the name of a subroutine (i.e. a soft reference).  If it's
the latter, then the code is even more poorly written; soft references are
almost always a bad idea.


Michael
--
Administrator                      www.shoebox.net
Programmer, System Administrator   www.gallanttech.com
--

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to