in reply to need to remove the extra line in regular expression
Now, it would also be good to have your "config.txt" file, but I'm going to try to answer your question anyway.
You have two print statements in your code, the second is conditional, if it contains an IP address you parse it and print it, but the first print is not conditional, you print $arr[0] on every iteration of the loop. If you want to print it only when you find an IP address, put this in the if statement too.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: need to remove the extra line in regular expression
by ulaksh (Acolyte) on Aug 22, 2012 at 13:32 UTC | |
by Anonymous Monk on Aug 22, 2012 at 13:35 UTC | |
by ulaksh (Acolyte) on Aug 22, 2012 at 13:46 UTC | |
by ulaksh (Acolyte) on Aug 22, 2012 at 14:05 UTC | |
by greengaroo (Hermit) on Aug 22, 2012 at 14:08 UTC |