opendir(DIR,"/etc")|| die "ERROR_MSG:$!\n"; foo(*DIR); sub foo{ my (*ETC) = $_[0]; while(){ print; } }