-- "Charles K. Clarkson" <[EMAIL PROTECTED]> wrote:

> John Ackley wrote:
> 
> 
> : while( ($service) = $SERVICE->fetchrow_array ) {
> 
>     According to the DBI docs:
> 
>    "If there are no more rows or if an error occurs,
>     then fetchrow_array returns an empty list."
> 
>     When a value is returned, $service is set to
> that value.
> When we get to the end of the list, () is returned
> and
> $service is set to the undefined value. Since it
> tests
> false, the while loop stops with $service set to an
> undefined
> value.
> 
>     You can see this in the following script.
> 
> use strict;
> use warnings;
> use Data::Dumper 'Dumper';
> 
> my $service;
> 
> ($service) = ();
> 
> print Dumper $service;
> 

John, 

For a complete understanding of scope (not listerine)
: )
please read the following:
http://perl.plover.com/local.html#2_Localized_Filehandles

and
http://www.perlmonks.org/?node_id=564448

Wow...opened my eyes and I now fully understand global
and non global variables.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


  • RE: Scope Derek B. Smith

Reply via email to