Hi Sunita, On Wed, 25 Nov 2015 13:23:24 +0530 Sunita Pradhan <sunita.pradhan.2...@hotmail.com> wrote:
> Hi > I want to create a unique array . You probably mean an "array with unique elements". To do so, you should use a hash. See: http://perl-begin.org/topics/hashes/ > I have the code below. It is creating a array which will have duplicate > data . How can I filter duplicate data ? Some comments on your code: 1. The indentation is erratic and inconsistent. See: http://perl-begin.org/tutorials/bad-elements/#no-indentation 2. It lacks "use strict;" and "use warnings;" . See: http://perl-begin.org/tutorials/bad-elements/#no-strict-and-warnings 3. "my $lif_cnt++;" does not make sense. Perhaps go over the rest of the page - http://perl-begin.org/tutorials/bad-elements/ . Regards, Shlomi Fish > #!/usr/bin/perl > > use Data::Dumper; > > > > #my $cnt = scalar @$net_int_parsed_output; > $net_int_parsed_output = [lif_1 ,lif_2,lif_3,lif_4,lif_1,lif_2]; foreach my $n > (@$net_int_parsed_output){ > > my > $lif_cnt++; > > print > "lif of vserver >>> $n\n"; > > > push > (@{$lun_PR_resv_info->{'lun'}->{'vserver'}->{'fcp_lifs'}},$n); > > } > > > > print "lun PR resv related > info>>>>>>>>>>>>>",Dumper > $lun_PR_resv_info,"\n"; > ThanksSunita -- ----------------------------------------------------------------- Shlomi Fish Please reply to list if it's a mailing list post -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/