Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Untraceable warning: "Warning: Use of "require" without parenthesesis ambiguous at (eval 23) line 1."

Reply
Thread Tools

Untraceable warning: "Warning: Use of "require" without parenthesesis ambiguous at (eval 23) line 1."

 
 
Julian Mehnle
Guest
Posts: n/a
 
      05-17-2006
Hi all,

I'm having problems tracing a

> Warning: Use of "require" without parentheses is ambiguous at (eval 23)line 1.


warning. It occurs in a larger program that has multiple "require"s and
"eval"s, and the line numbers aren't helpful at all.

I have tried inserting "use diagnostics qw(-traceonly -warntrace);" into
the program, but I still don't get a stack trace, just the exact same
warning message.

What can I do to get a stack trace?

TIA,
Julian Mehnle.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEaoBMwL7PKlBZWjsRAmkJAKD7eikG+W1QkcT8Z/cX093PU5OSiwCgp5nH
dJm4Sq9rdzd/k0Or+g5xdV4=
=ltX1
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
 
Julian Mehnle
Guest
Posts: n/a
 
      05-17-2006
Julian Mehnle wrote:
> I have tried inserting "use diagnostics qw(-traceonly -warntrace);" into
> the program, but I still don't get a stack trace, just the exact same
> warning message.


Sorry for replying to myself, but a minor correction is in order: it's
"-trace", not "-traceonly" (the latter is described in `perldoc
diagnostics`, but only the former actually works).

Julian.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEaoElwL7PKlBZWjsRAugBAKCzGnmVcsz38UmZEBYD3u yRPiKDwACfdfP0
BkK+Hl8a66ar5b877CmziII=
=HTp7
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
 
Julian Mehnle
Guest
Posts: n/a
 
      05-17-2006
Julian Mehnle wrote:
> Julian Mehnle wrote:
>> I have tried inserting "use diagnostics qw(-traceonly -warntrace);"
>> into the program, but I still don't get a stack trace, just the exact
>> same warning message.

>
> Sorry for replying to myself, but a minor correction is in order: it's
> "-trace", not "-traceonly" (the latter is described in `perldoc
> diagnostics`, but only the former actually works).


Now I guess I've almost used up my good karma for this year, having to
make yet another amendment to my posting. I did NOT mean to say that
"use diagnostics qw(-trace -warntrace);" "actually works" to give me a
stack trace (sorry for the ambiguous wording). It doesn't -- it just
doesn't blow in my face as "qw(-traceonly)" (as documented in the
diagnostics module) does.

So how can I get a stack trace to debug this 'Use of "require" without
parentheses is ambiguous' warning?

Julian.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEaoKUwL7PKlBZWjsRAoR0AKCBz9AnF05xjEcPhVl97x bl8v+a1wCgj3wH
fdrD3dRePldJ0JmIV9A5Sz8=
=w3we
-----END PGP SIGNATURE-----

 
Reply With Quote
 
Ben Morrow
Guest
Posts: n/a
 
      05-17-2006

Quoth Julian Mehnle <(E-Mail Removed)>:
> Julian Mehnle wrote:
> > Julian Mehnle wrote:
> >> I have tried inserting "use diagnostics qw(-traceonly -warntrace);"
> >> into the program, but I still don't get a stack trace, just the exact
> >> same warning message.

>
> Now I guess I've almost used up my good karma for this year, having to
> make yet another amendment to my posting. I did NOT mean to say that
> "use diagnostics qw(-trace -warntrace);" "actually works" to give me a
> stack trace (sorry for the ambiguous wording). It doesn't -- it just
> doesn't blow in my face as "qw(-traceonly)" (as documented in the
> diagnostics module) does.
>
> So how can I get a stack trace to debug this 'Use of "require" without
> parentheses is ambiguous' warning?


I get

~% perl -v

This is perl, v5.8.7 built for i686-linux
....

~% perl -Mdiagnostics=-trace,-warntrace -le'sub foo{warn "foo"; die} foo'
foo at -e line 1.
at -e line 1
main::foo() called at -e line 1

Uncaught exception from user code:
Died at -e line 1.
at -e line 1
main::foo() called at -e line 1

However, I also get

~% perl -Mdiagnostics=-w,-t -le'sub foo{require +5} foo'
Warning: Use of "require" without parentheses is ambiguous at -e line 1.
at -e line 1

: the warning is issued at compile time, so there is no call to &foo in
the stack trace, indeed no stack at all yet. The file/line no should be
right, though.

Ben

--
Razors pain you / Rivers are damp
Acids stain you / And drugs cause cramp. [Dorothy Parker]
Guns aren't lawful / Nooses give
Gas smells awful / You might as well live. http://www.velocityreviews.com/forums/(E-Mail Removed)
 
Reply With Quote
 
xhoster@gmail.com
Guest
Posts: n/a
 
      05-17-2006
Julian Mehnle <(E-Mail Removed)> wrote:
>
> Hi all,
>
> I'm having problems tracing a


> Warning: Use of "require" without parentheses is ambiguous at
> (eval)
> line 1.
>
> warning. It occurs in a larger program that has multiple "require"s and
> "eval"s, and the line numbers aren't helpful at all.
>
> I have tried inserting "use diagnostics qw(-traceonly -warntrace);"


Those appear to only trace run-time warnings, not compiler warnings.
(Even if the thing being compiled is in an eval.)


>
> What can I do to get a stack trace?


Maybe:

use Carp qw(cluck);
$SIG{__WARN__}=sub {cluck
$_[0]};


Xho

--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
 
Reply With Quote
 
Julian Mehnle
Guest
Posts: n/a
 
      05-17-2006
Ben Morrow wrote:
> ~% perl -Mdiagnostics=-w,-t -le'sub foo{require +5} foo'
> Warning: Use of "require" without parentheses is ambiguous at -e line 1.
> at -e line 1
>
> : the warning is issued at compile time, so there is no call to &foo in
> the stack trace, indeed no stack at all yet.


Makes sense. Too bad.

> The file/line no should be right, though.


Well, "at (eval) line 1" isn't very helpful because there are lots of
one-line "eval"s in my project, and "(eval 23)" presumably means the 23rd
"eval" encountered, but which one is that?

I'm at a total loss as of how to crack this nut, save from running it
through `perl -d`, which isn't really viable given that the project's size
is non-trivial and I haven't found out yet how to reproduce the bug. (Oh,
and it's a CGI application.)

Julian.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEaxe5wL7PKlBZWjsRAgCEAKC8EtHIw/aXVXw1QDymtEm9rWOKIACdE5MR
ePYuXN+ptgHKIeYX73TdAsc=
=2Lfe
-----END PGP SIGNATURE-----

 
Reply With Quote
 
Julian Mehnle
Guest
Posts: n/a
 
      05-17-2006
(E-Mail Removed) wrote:
>> What can I do to get a stack trace?

>
> Maybe:
>
> use Carp qw(cluck);
> $SIG{__WARN__}=sub {cluck $_[0]};


I tried

use Carp qw(verbose);
BEGIN { $SIG{__WARN__} = sub { Carp::cluck(@_) } }

...but it didn't help. The WARN handler wasn't invoked by the compiler
warning.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEaxhnwL7PKlBZWjsRAnM6AKCCd+NdEOABt6jYXQPI4i Hn5irH6ACgqAET
pn2XLpugJY8zx7M/A3SHC1M=
=SPaW
-----END PGP SIGNATURE-----

 
Reply With Quote
 
David Squire
Guest
Posts: n/a
 
      05-17-2006
Julian Mehnle wrote:
> Ben Morrow wrote:
>> ~% perl -Mdiagnostics=-w,-t -le'sub foo{require +5} foo'
>> Warning: Use of "require" without parentheses is ambiguous at -e line 1.
>> at -e line 1
>>
>> : the warning is issued at compile time, so there is no call to &foo in
>> the stack trace, indeed no stack at all yet.

>
> Makes sense. Too bad.
>
>> The file/line no should be right, though.

>
> Well, "at (eval) line 1" isn't very helpful because there are lots of
> one-line "eval"s in my project, and "(eval 23)" presumably means the 23rd
> "eval" encountered, but which one is that?
>
> I'm at a total loss as of how to crack this nut, save from running it
> through `perl -d`, which isn't really viable given that the project's size
> is non-trivial and I haven't found out yet how to reproduce the bug. (Oh,
> and it's a CGI application.)


Perhaps just at the command line, grep for require, with a view lines of
context either side so that you can see if it's in an eval, and look for
ones that look potentially ambiguous?

DS
 
Reply With Quote
 
Ben Morrow
Guest
Posts: n/a
 
      05-17-2006

Quoth Julian Mehnle <(E-Mail Removed)>:
> -=-=-=-=-=-
>
> Ben Morrow wrote:
> > ~% perl -Mdiagnostics=-w,-t -le'sub foo{require +5} foo'
> > Warning: Use of "require" without parentheses is ambiguous at -e line 1.
> > at -e line 1
> >
> > : the warning is issued at compile time, so there is no call to &foo in
> > the stack trace, indeed no stack at all yet.

>
> Makes sense. Too bad.
>
> > The file/line no should be right, though.

>
> Well, "at (eval) line 1" isn't very helpful because there are lots of
> one-line "eval"s in my project, and "(eval 23)" presumably means the 23rd
> "eval" encountered, but which one is that?


An eval is different; here, there *is* a runtime stack and Perl should
show it you. I get

~% perl -Mdiagnostics=-w,-t -e'1;' -e'sub foo {eval "require +5;"} foo'
Warning: Use of "require" without parentheses is ambiguous at (eval 2) line 1.
at (eval 2) line 1
eval 'require+5;' called at -e line 2
main::foo() called at -e line 2

which seems to me to contain all required information; do you get
something different?

> I'm at a total loss as of how to crack this nut, save from running it
> through `perl -d`, which isn't really viable given that the project's size
> is non-trivial and I haven't found out yet how to reproduce the bug. (Oh,
> and it's a CGI application.)


I have to say, I can't see how you could get that warning without doing
something pretty weird. The warning is issued for require followed
immediately by a binary operator; you could try grepping for
'require[[:space:]]*\+' and so on...

Ben

--
And if you wanna make sense / Whatcha looking at me for? (Fiona Apple)
* (E-Mail Removed) *
 
Reply With Quote
 
Ilya Zakharevich
Guest
Posts: n/a
 
      05-17-2006
[A complimentary Cc of this posting was sent to
Julian Mehnle
<(E-Mail Removed)>], who wrote in article <e4f53q$i6i$(E-Mail Removed)-online.net>:
> Well, "at (eval) line 1" isn't very helpful because there are lots of
> one-line "eval"s in my project, and "(eval 23)" presumably means the 23rd=
>
> "eval" encountered, but which one is that?
>
> I'm at a total loss as of how to crack this nut, save from running it
> through `perl -d`, which isn't really viable given that the project's siz=
> e
> is non-trivial and I haven't found out yet how to reproduce the bug. (Oh=
> ,
> and it's a CGI application.)


What has perl -d to do with the project size? You should get all the
info from debugger.

Hope this helps,
Ilya
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to make a private/untraceable ip? suny General Computer Support 1 01-27-2009 06:22 AM
New releases: Ultimate Dirty Harry, Untraceable & Red Violin: Updated complete downloadable R1 DVD DB & info lists Doug MacLean DVD Video 0 03-25-2008 07:25 AM
Use of "caller" is ambiguous Ferry Bolhar Perl Misc 4 10-12-2007 12:59 PM
How to read a text file line by line and remove some line kaushikshome C++ 4 09-10-2006 10:12 PM
Read a file line by line with a maximum number of characters per line Hugo Java 10 10-18-2004 11:42 AM



Advertisments