Gossamer Forum
Home : Products : Gossamer Links : Discussions :

What's This?

Quote Reply
What's This?
Building HTML pages...

Creating backup file...
"my" variable $sth masks earlier declaration in same scope at /xxxxxx/local/home/xxxxx/xxxxx.com/cgi-bin/links/admin/Plugins/PageBuilder.pm line 996.
Done (11.00s)

Never had this show before, crazy things happen out of the blue.

I think my server is going crazy, or having a bad day!
Quote Reply
Re: [rascal] What's This? In reply to
This means that the variable $sth has already been declared like this:
my $sth = something

and then some where further down the code it's being declared again:
my $sth = something or maybe something else.

make sense?
Quote Reply
Re: [klangan] What's This? In reply to
Thanks for your reply, I assume being declared twice won't hurt anything.

Everything seems to being working fine.
Quote Reply
Re: [rascal] What's This? In reply to
Shouldn't hurt, but it tends to cause confusion as you're seeing.

For example: I've occassionally declared a variable outside of an if statement then again inside(usually from a cut and paste) expecting to be able to retrieve the value outside of the if statement and doing so doesn't cause an error (makes me think the code is correct), but then I can't retrieve the value outside of the if statement which has sometimes lead to 10 or 15 minutes of wasted time before I discover that I've masked my variable.

peace.