in reply to "use strict" and undeclared variables
omfg.. yours is the funniest post i've seen in a long time..
It's because @row is not being declared.. that is.. it's not being told 'row exists in this area of the program'.
keep using strict! Trust the strict- Strict is good- Strict is your friend. It's your girlfriend who loves you but won't put up with any of your 5h1+.
If she whines and complains.. it means you need to stop that- or your code 'looks' like it's working.. but it's *not*.
Like moritz suggested, this should work:
while ( my @row = $sth->fetchrow_array ) { print "@row\n"; }
Again, what is happening is that you don't say anywhere 'my @row'.
You could also have done this.. (althought bad form and possibly buggy):
updateikegami suggests these snipplets are essentially the same, and that the second is not bad form or possibly buggy. And it was the # on strict that cracked me up. It's like when my two year old goges 'mommy i'm hot' so she pours a glass of cold organge juice all over herself and says 'now everything is great!'- that it's funny doesn't mean you have ill feelings for the situation.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: "use strict" and undeclared variables
by mjscott2702 (Pilgrim) on Oct 11, 2007 at 20:16 UTC | |
|
Re^2: "use strict" and undeclared variables
by chrism01 (Friar) on Oct 12, 2007 at 00:37 UTC | |
by polettix (Vicar) on Oct 12, 2007 at 08:49 UTC | |
by blazar (Canon) on Oct 12, 2007 at 12:31 UTC | |
by leocharre (Priest) on Oct 18, 2007 at 18:19 UTC |