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



[Article reformatted. Please keep a consistent line length of about 70
characters. Alternating between long and extremely short lines may be
nice in a poem but is hard to read in prose]

On 2006-11-10 10:23, Ronny <ro.naldfi.scher@xxxxxxxxx> wrote:
Ben Morrow schrieb:
Quoth "Ronny" <ro.naldfi.scher@xxxxxxxxx>:
Ben Morrow schrieb:
[weird error messages from the Text::Balanced module]
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.
[...]

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

Possible, but unlikely. Unless you use another module which uses
Text::Balanced, you aren't calling Text::Balanced any more and hence
can't get any error messages from it any more.

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.

I don't think it has anything to do with the size. The problem was
probably that the Switch module needs to parse the source code and that
uses a different grammar than perl (which is unavoidable, as the purpose
of Switch is to change the grammar). So changing a character which
shouldn't make a difference in Perl does make a difference in
Perl+Switch.

hp

--
_ | Peter J. Holzer | > Wieso sollte man etwas erfinden was nicht
|_|_) | Sysadmin WSR | > ist?
| | | hjp@xxxxxx | Was sonst wäre der Sinn des Erfindens?
__/ | http://www.hjp.at/ | -- P. Einstein u. V. Gringmuth in desd
.



Relevant Pages

  • Re: perl or sed for string search and replace
    ... Perl is run with the -p switch which loops over input from either stdin or from the files listed on the command line and prints out $_ which contains the contents of the current line. ... That is the substitution operator which modifies the contents of $_ using the regular expression pattern in the first part and replacing it with the string in the second part. ... \b is a zero-width assertion that matches between a \w and a \W character. ...
    (comp.unix.shell)
  • Re: What is going on?
    ... Problem is i do not know Perl. ... $#ARGV is the array index of the last variable entered. ... $epc variable plus a '/' character. ... Save the return value of the $response->content subroutine. ...
    (comp.lang.perl.misc)
  • Re: A Unicode introduction for the Mac?
    ... Mostly I need a way to seemlessly switch between Roman and Greek fonts. ... the Greek Keyboard others tell me to use the Character Palette ...
    (comp.sys.mac.apps)
  • Re: Dynamically updating perl variables
    ... character of multi-character parameter values. ... The intention was that, once the data was in a Perl data structure, the calling ... the case of your given data subroutine would return a list that, ... nice to see what a full alternative solution would look like using your ideas. ...
    (perl.beginners)
  • Re: writing binary files
    ... > Python or Perl, since your post referred to Python:-D ... looks as though it would require a template character to be passed for every ...
    (comp.lang.perl.misc)