in reply to proccessing file paragraphs -braindead i am ..

you can use a simple array to hold the hosts, as in:

open(HOSTDB,"hostdb") or die "cannot open hostdb"; # open hosts one time only. my @hosts; # array to hold the hosts. while(<HOSTDB>){ push @hosts, chomp($_); } # using scalar on an array will give you the number of elements print "number of records - ", scalar @hosts, "\n"; close(HOSTDB); # instead of counting and selecting the hosts, use perl's foreach # to loop inside the @hosts array foreach my $host (@hosts){ print "------host.$host--------\n"; for my $field (split /\n/, $host ) { print "Field contains: '$field'\n"; } }

He who asks will be a fool for five minutes, but he who doesn't ask will remain a fool for life.

Chady | http://chady.net/