sub get_hosts { my $file = shift; open (HOSTS, <$file) or die("I can't open $file"); while () { if ( /^include (.*)$/ ) get_hosts($1); &parse_line; } close HOSTS; }