$file = '/root/db.dns.com'; # Name the file open(INFO, $file); # Open the file @lines = ; # Read it into an array close(INFO); # Close the file #print @lines; # Print the array foreach $i (@lines) { @a = split(/ /, $i); print @a[0] . "\n"; } #### asdfrbrn IN A 206.23.12.5 a234rn IN A 206.23.12.5