Hi ArifS,
You should probably provide some context for your question by linking to the thread this question comes from (you posted a near-duplicate of your question here). I took a look at the code and various sample inputs from that thread, and it is unclear to me which duplicates your are trying to detect - when I look at the @lists variable I hardly see any duplicates, except maybe in the "groups" item of the data structure*.
The best way to get answers is to provide: 1. sample input (in this case you're working with Perl data structures, so use Data::Dumper to output them), 2. runnable code we can use to test, and 3. the expected output and the actual output including exact error messages. See also How do I post a question effectively? and "SSCCE".
* When I use this code on this sample input data, here's what @lists looks like:
(
{
groups => ["INSIDE_IN", "WEB-CLIENT", "WEB-SERVER", "WEB_TCP"],
line => "access-list INSIDE_IN extended permit tcp object-group
+WEB-CLIENT object-group WEB-SERVER object-group WEB_TCP\n",
},
{
groups => ["INSIDE_IN", "EMAIL-CLIENT", "EMAIL-SERVER", "SMTP_TCP"
+],
line => "access-list INSIDE_IN extended permit tcp object-group
+EMAIL-CLIENT object-group EMAIL-SERVER object-group SMTP_TCP\n",
},
{
groups => ["INSIDE_IN", "WEB_TCP"],
line => "access-list INSIDE_IN extended permit tcp object-group
+MYSRVR_2nd object-group MYCLIENTS_1st object-group WEB_TCP\n",
},
)
Hope this helps, -- Hauke D |