On Thu, Aug 30, 2001 at 04:50:48PM +0100, Jose Abilio Oliveira Matos wrote:
> On Thu, Aug 30, 2001 at 08:49:49AM -0400, Amir Karger wrote:
> 
> > I'm pretty sure that the problem here is that you're missing a &.
> > I think you have to write:
> > 
> >     $LyX_Preamble .= &{$Geometry_Options{$op}}();
> > 
> > That is, $Geometry_Options{$op} is a reference to a subroutine, so you need
> > to &{...}() it to actually call the subroutine.
> 
>   Or the other option from Yves, no?
>   $Geometry_Options{$op}->()

Yeah, that's OK too.

>   I only know some of the basics and it made lots of sense that if I define
> an annonomous function to call it only adding the parentheses, that is
> equivalent to prefixing it with an &.

Right. So it's just that Perl didn't have the sophisticated understanding of
$foo(bar) beforehand. (Of course, this opens up the possibility of bugs,
because I sometimes write $foo(bar) when I meant $foo[bar]. Leftover habit
from BASIC, I guess.)

-Amir

Reply via email to