Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > Unusual warning - what's it trying tell me?

Reply
Thread Tools

Unusual warning - what's it trying tell me?

 
 
Derek Fountain
Guest
Posts: n/a
 
      08-22-2005
I've just inherited a rather horrible bit of code which I'm making run
with use strict. (Yes, it's that bad.) It contains this:

if ( ( $e > ( $rt + $ett ) )
&& ( $rt ne "" )
&& ( ${kill} == $TRUE ) )
{

where $kill is a local (my) variable. This produces this:

"Ambiguous use of ${kill} resolved to $kill at ..."

If I remove the {} from around the kill (which are unnecessary anyway)
then the problem goes away. I've never seen that and it puzzles me.
What's it trying to tell me? The function contains a varible called
$killed is that makes a difference...
 
Reply With Quote
 
 
 
 
Charlton Wilbur
Guest
Posts: n/a
 
      08-22-2005
>>>>> "DF" == Derek Fountain <(E-Mail Removed)> writes:

DF> && ( ${kill} == $TRUE ) )

DF> where $kill is a local (my) variable. This produces this:

DF> "Ambiguous use of ${kill} resolved to $kill at ..."

DF> If I remove the {} from around the kill (which are unnecessary
DF> anyway) then the problem goes away. I've never seen that and
DF> it puzzles me. What's it trying to tell me?

There's a builtin function called kill; perldoc -f kill.

${kill} can legitimately be interpreted as either $kill or ${kill()};
Perl is warning you that it's interpreting it as $kill so that if you
really meant ${kill()} you can rewrite that line.

Removing the {} in that case is probably the wise thing to do.

Charlton



--
cwilbur at chromatico dot net
cwilbur at mac dot com
 
Reply With Quote
 
 
 
 
Derek Fountain
Guest
Posts: n/a
 
      08-22-2005
> There's a builtin function called kill; perldoc -f kill.

So there is. I forgot about that. } Make perfect sense now...

Thanks.
 
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
Unusual problems trying to host game server Jason08 Hardware 0 10-20-2008 11:19 PM
Trying to find an unusual game L1ghtrail Computer Support 2 12-03-2007 07:17 PM
Unusual warning Arash Partow C Programming 2 06-01-2007 02:05 AM
CAN any one tell it whats the code tell it yogesh C++ 1 03-14-2007 01:12 PM
unusual warning XP Pro sligo Computer Support 1 04-01-2005 06:49 PM



Advertisments