got it ... thank you.  cheers!



________________________________
From: Brandon McCaig <bamcc...@gmail.com>
To: Tony Esposito <tony1234567...@yahoo.co.uk>
Cc: beginners@perl.org
Sent: Fri, 12 August, 2011 14:08:52
Subject: Re: while(@data) works but why

On Fri, Aug 12, 2011 at 3:02 PM, Tony Esposito
<tony1234567...@yahoo.co.uk> wrote:
> .
> .
> .
> while(@dat = $sth->fetchrow) {
>        print "@dat\n";
> .
> .
> .
>
> This code works yet there is no 'my @dat' defined anywhere in the code.
> Using Perl 5.8.x - 5.14.x
>
> Q: Why does the variable @dat not need a 'my' in front?

See `perldoc strict'. In particular, the "strict vars" section.


-- 
Brandon McCaig <http://www.bamccaig.com/> <bamcc...@gmail.com>
V zrna gur orfg jvgu jung V fnl. Vg qbrfa'g nyjnlf fbhaq gung jnl.
Castopulence Software <http://www.castopulence.org/> <bamcc...@castopulence.org>

Reply via email to