mlhmich has asked for the wisdom of the Perl Monks concerning the following question:
$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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split issue
by jfroebe (Parson) on Jan 02, 2005 at 01:25 UTC | |
by holli (Abbot) on Jan 02, 2005 at 06:20 UTC | |
|
Re: split issue
by Mr. Muskrat (Canon) on Jan 02, 2005 at 18:31 UTC | |
|
Re: split issue
by Zaxo (Archbishop) on Jan 02, 2005 at 07:30 UTC | |
|
Re: split issue
by CountZero (Bishop) on Jan 02, 2005 at 09:24 UTC | |
| A reply falls below the community's threshold of quality. You may see it by logging in. |