in reply to object scope problem?

I don't see a problem related to your object, but I know that Switch can cause some strange problems. I'd recommend rewriting the code that uses it, and see if the problem persists. Also, you could be capturing the fields you want during regex matches instead of doing a separate split.

while (<CONF>) { if ( /^interface (\S+)/ ) { $cur_int = $1; $int{$cur_int}{ip}=""; } elsif ( /^ ip address ([\d\.]+) ([\d\.]+)$/ ) { my ( $ip, $mask ) = ( $1, $2 ); $int{$cur_int}{ip}=MyIP->new($ip, $mask) or die "incorrect IP address: $ip $mask\n"; print "$cur_int: $ip $mask = ", $int{$cur_int}{ip}->print_cidr(), +"\n"; } }