open( IFCFG, "ifconfig -a |" ) or die "Can't open pipe from ifconfig: $!\n"; my %ifs; while( ) { chomp; ## ... } close( IFCFG );