Nguyen Vu Hung <[EMAIL PROTECTED]> writes: > Here is the code ( check if $obj is undefined inside foreach ) > > ------------ > package XXX::YYY3; > > @ISA = qw(Net::Cmd IO::Socket::INET); > > sub new > { > my $self = shift; > my $type = ref($self) || $self; > > my $hosts = "localhost"; > my $obj; > my @localport = (); > > my $h; > foreach $h (@{$hosts})
Are you using symrefs or something? $hosts here is a scalar, not an arrayref. Are you sure the loop is being entered at all? -- Joe Schaefer