Hi, I'm completly confused by this my(X) not being available outside of a
subroutine, I've read everything but must not still get it....is this an
approriate solution? it makes @countries available...

 my @countries; <- solution?
 my $sql = "select distinct country from geo";
 my $sth = $match::dbh->prepare( "$sql" );
 $sth->execute;
 while ( (my $country_db) = $sth->fetchrow )
 {
  push(@countries,"$country_db");
 }

I've read the solutions but dang if they don't seem like rocket science for
something simple. Like suppose I wanted to do this
if ($var eq "whatever) {
    $sql = "select.....yada";
} else {
    $sql="somthing else...";
}
dbi $sql stuff
In this case $sql wouldn't be available and use strict would complain. So if
I did this:
my ($sql);
if....as above

Is that an appropiate solution?

Thanks for _any_ info anyone can provide,
shawn


Reply via email to