On Thu, Aug 30, 2001 at 08:49:49AM -0400, Amir Karger wrote:

> > 
> >  305      if( $Latex_Preamble =~ /\\geometry\{(.*)\}/) {
> >  306          my $geom_options = $1;
> >  307          my $op;
> >  308          foreach $op (keys %Geometry_Options) {
> >  309              $geom_options =~ s/$op// && do {
> >  310                  $LyX_Preamble .= $Geometry_Options{$op}();
> 
> 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}->()

> >   I'm using perl 5.6.0 and I don't have a problem with it, while Michael is
> > using  perl 5.004 or 5.005, I can't decide from the @INC...
> 
> Actually, I'm a bit surprised that 560 works on that. Could it be that if
> you try to stringify a code reference, Perl calls the sub with no arguments?
> Or maybe the parentheses make Perl realize it's a sub.

  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 &.

  It makes sense to anyway. I will fix the code nevertheless.
  
> -Amir

-- 
José

Reply via email to