Did not find leading dereferencer, detected at offset

S

sfelkes

Hi,

I'm getting a very strange error:

Uncaught exception from user code:
Did not find leading dereferencer, detected at offset 8231.

Its very frustrating because it's not relating it to a specific line of
code and I have 8000 lines of code in my Perl module. Often I can use
my Perl module find but then when I put in a simple print statement in
I get the error. Could you tell me what type of things cause this
error?

I used to use prototypes but I took those out. Instead in subroutines I
dereference as @{ $_[0] ) when I'm expecting an array as one of my
arguments and @_ when an array is the only argument. I use my $hash =
$_ when a hash is passed as the only or one of the arguments. I
store references to arrays as $array[$i] = \@array.

Any ideas?

Cheers,

Sean
 
B

Ben Morrow

Quoth (e-mail address removed):
I'm getting a very strange error:

Uncaught exception from user code:
Did not find leading dereferencer, detected at offset 8231.

Its very frustrating because it's not relating it to a specific line of
code and I have 8000 lines of code in my Perl module. Often I can use
my Perl module find but then when I put in a simple print statement in
I get the error. Could you tell me what type of things cause this
error?

As someone else said, this is a Text::Balanced error, so the offset is
into whatever string you where matching against. Something I find useful
in this case is this little module:

package Carp::AllVerb;

use strict;
use warnings;

use Carp qw/verbose/;

$SIG{__DIE__} = sub {
die @_ if $^S or not defined $^S;
Carp::confess @_;
};

$SIG{__WARN__} = sub {
warn @_ if $^S or not defined $^S;
Carp::cluck @_;
};

1;

, which you use like perl -MCarp::AllVerb myscript, and which then
causes any warn or die to produce a full stack trace.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,201
Messages
2,571,049
Members
47,653
Latest member
YvonneJif

Latest Threads

Top