$file = '/root/db.dns.com'; # Name the file open(INFO, $file); # Open the file @lines = <INFO>; # 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"; }
I need to get each item into a array. I don't know how many spaces there are between each word. I also need to make sure that the first item starts with a letter a-z A-Z. Can I do this with perl?asdfrbrn IN A 206.23.12.5 a234rn IN A 206.23.12.5
In reply to split issue by mlhmich
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |