Re: "Did not find leading dereferencer" - new findings to an old puzzle
- From: Ben Morrow <benmorrow@xxxxxxxxxxxxx>
- Date: Wed, 8 Nov 2006 21:01:55 +0000
Quoth "Ronny" <ro.naldfi.scher@xxxxxxxxx>:
Ben Morrow schrieb:
Quoth "Ronny" <ro.naldfi.scher@xxxxxxxxx>:
Ferry Bolhar schrieb:
"Did not find leading dereferencer":This doesn't make any sense. First, I don't include in my programs any
"extract_variable" was expecting one of '$', '@', or '%' at the
start of a variable, but didn't find any of them.
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. Switch has a number of known bugs, and
is deprecated in favour of the real given/when statements in the
upcoming 5.10; for instance, with the current perl development version:
~/src/perl% cat switch
use feature qw/switch say/;
my $foo = shift;
given ($foo) {
when (/a+/) { say "A"; }
when (2) { say "TWO"; }
default { say "something else"; }
}
~/src/perl% ./bleadperl/perl -I./bleadperl/lib switch aaa
A
~/src/perl% ./bleadperl/perl -I./bleadperl/lib switch 2
TWO
~/src/perl% ./bleadperl/perl -I./bleadperl/lib switch foo
something else
But I would hardly recommend using bleadperl, or even one of the 5.9.x
releases, for production work, either.
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.
Ben
--
Heracles: Vulture! Here's a titbit for you / A few dried molecules of the gall
From the liver of a friend of yours. / Excuse the arrow but I have no spoon.
(Ted Hughes, [ Heracles shoots Vulture with arrow. Vulture bursts into ]
'Alcestis') [ flame, and falls out of sight. ] benmorrow@xxxxxxxxxxxxx
.
- Follow-Ups:
- References:
- Prev by Date: Re: are appservers BS? is python a bunch of snooty wankers?
- Next by Date: Re: are appservers BS? is python a bunch of snooty wankers?
- Previous by thread: Re: "Did not find leading dereferencer" - new findings to an old puzzle
- Next by thread: Re: "Did not find leading dereferencer" - new findings to an old puzzle
- Index(es):
Relevant Pages
|