in reply to Is this logic correct? Maybe can be rewritten better?

while( $row = $sth->fetchrow_hashref ) { if( $host eq $row->{host} ) { my $hostmatch = 1; } }
This doesn't make a lot of sense; you probably want to scope $hostmatch outside the while loop.

Replies are listed 'Best First'.
Re^2: Is this logic correct? Maybe can be rewritten better?
by ikegami (Patriarch) on Apr 29, 2005 at 15:06 UTC
    That means the you, the OP, probably aren't using use strict. If you had, elsif( $hostmatch == 1 ) would have resulted in an error unless you declared $hostmatch twice. Please use use strict; use warnings; and address any resulting errors and warnings.
    A reply falls below the community's threshold of quality. You may see it by logging in.