burningredmoon has asked for the wisdom of the Perl Monks concerning the following question:
Now, I would like to take a line, and separate two things with a comma from a file. One being one variable and the other, another variable. Kind of like so:
DomainName, IPAddress DomainName2, IPAddress2
If I'm storing this information in a file that is being read, what is the best way to separate them so I may match IPs I capture in my program to the IPAddresses in my file and then print the DomainName (from my file) that goes with said IP?
I've been told split is a great way to do this but I'm not sure how and just looking at the generic way to use it from Google results isn't going so well for me. Thank you for reading in advance!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: To Split or Not to Split
by FunkyMonk (Bishop) on Apr 24, 2011 at 23:31 UTC | |
by tchrist (Pilgrim) on Apr 25, 2011 at 02:18 UTC | |
by Corion (Patriarch) on Apr 25, 2011 at 07:59 UTC | |
by burningredmoon (Novice) on Apr 25, 2011 at 00:10 UTC | |
|
Re: To Split or Not to Split
by Anonymous Monk on Apr 24, 2011 at 22:02 UTC | |
by burningredmoon (Novice) on Apr 24, 2011 at 22:34 UTC | |
by wind (Priest) on Apr 24, 2011 at 22:57 UTC | |
by burningredmoon (Novice) on Apr 25, 2011 at 00:05 UTC | |
by Anonymous Monk on Apr 24, 2011 at 23:01 UTC | |
by burningredmoon (Novice) on Apr 24, 2011 at 23:28 UTC |