thanks a lot Anonymous Monk.You are right, it works fine with the example I have given .
But suppose I add another line below "snmp ok" (at the same level) :-
ipaddress#1
Then the code is printing the hirarechy twice for me ..once till "snmp ok" and once till "ipaddress#1".
Second thing, I tried to open both the config files as a file handler (Becase in real world the files will be too huge to keep in the code) and tried to run the code (with minimal changes), the code didnt work .
In reply to Re^2: Finding the parent of a text in a file
by ExperimentsWithPerl
in thread Finding the parent of a text in a file
by ExperimentsWithPerl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |