My problem is simple. I want to parse an Oracle TNS file, listing
host and the service it provides.
A sample TNS entry is multi-lined and looks like this:
mysprdtmp =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = mxr)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = mysprd01)
)
)
The regex I am using to parse this looks like so:
mysprdtmp =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = mxr)(PORT = 1521))
)
(CONNECT_DATA =
(SERVER = DEDICATED)
(SERVICE_NAME = mysprd01)
)
)
My code snippit is like this:
while (chomp($para = <F>)) {
undef($host);
undef($name);
if ($para =~ m[$tnsEntry]msxo) {
....
}
The problem is, that this works great, EXCEPT for cases where I do not
have a blank line separating two concatenated TNS entries (I only get
the last one).
Any help would be greatly appreciated.
Thanks
Jeff
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>