Re: "Did not find leading dereferencer" - new findings to an old puzzle



Ben Morrow schrieb:
Quoth "Ronny" <ro.naldfi.scher@xxxxxxxxx>:

Ben Morrow schrieb:

Quoth "Ronny" <ro.naldfi.scher@xxxxxxxxx>:
Ferry Bolhar schrieb:
"Did not find leading dereferencer":
"extract_variable" was expecting one of '$', '@', or '%' at the
start of a variable, but didn't find any of them.
This doesn't make any sense. First, I don't include in my programs any
Text:: stuff. Second, this would not explain why the error message
changes to the real one, if, say, I remove one comment line from the
source code.

Are you by any chance using any modules that set up source filters?
Switch.pm, perhaps? These often use Text::Balanced to do their work, and
it isn't quite as good at parsing Perl as it might be.

Indeed I do have a

use Switch 'Perl6';

in this module. Good point.

Hmmm. You presumably don't want to rewrite your code not to use Switch;
that would be my recommendation.

Actually, *this* is the least problem. The use Switch was in the code
only for
historic reason, and I have removed it. I don't know of course if
*this* was sufficient
to make the error go away: After all, the removal of the statement made
the code
a little bit smaller, so the problem might simply have disappeared for
*this* reason
(removing a comment line instead of the use Switch would have had the
same
effect). Since the code is still being changed a lot, I think I will
see during the
following weeks whether the removal of the Switch module will remedy
the situation.

As usual, if you reduce your script to the *minimal* example which
reproduces the problem (yes, in this case this might be a lot of work),
and post it here, I'm sure someone can tell you what's going on.

The problem with errors which occur only in "sufficiently big" source
files is that the minimal example is still fairly big. In my case, I
have reduced it to the extent that deleting one single character (for
example, the "#" in front of an empty comment line) already makes this
error go away. Still, the source file is around 350 lines big.

If the error really only occurs with large source files, then the
obvious workaround is to split your module into two.

This certainly is, although I it surprised me that 350 lines - quite a
few of them
being comments - is already too large to be handled in a single module.
Think
of the cases where you document a module using perlpod - in this case,
the
POD documentation alone can easily approach 350 lines. What do you
think?

Ronald

.



Relevant Pages

  • Re: "Did not find leading dereferencer" - new findings to an old puzzle
    ... You presumably don't want to rewrite your code not to use Switch; ... given ($foo) { ... But I would hardly recommend using bleadperl, or even one of the 5.9.x ... the source file is around 350 lines big. ...
    (comp.lang.perl.misc)
  • Problem executing program from KN Kings booc
    ... source file, and cutting and pasting the text into a new source file. ... int month, day, year; ... printf(" day of "); ... switch { ...
    (comp.compilers.lcc)
  • Re: Just uninstalled Delphi 2005 Enterprise
    ... Günther Schoch skrev: ... We tested a lot before the switch and some issues are important ... than one syntax error at any give time in the source file that is open in the editor, the risk is much higher the IDE will die in a cascade of catastrophic failures. ...
    (borland.public.delphi.non-technical)
  • RE: Using MS Visual Studio.net to write Ms visual C++ 6.0
    ... - turn off the /clr switch ... - add #pragma unmanaged to every source file in your project ... take a look in the property panel of your project ... and config it the way you need ...
    (microsoft.public.dotnet.languages.vc)