I was not able to compare 2 sepearate columns exists in 2 separate sheets, need your help to identify the mistake in my code

for my $worksheet1 ( $workbook1->worksheets() ) { $worksheet->write(0, 0, 'AD Match' , $my_format); $worksheet->write(0, 1, 'APP STATUS' , + $my_format); $worksheet->write(0, 2, 'APP LABEL' , +$my_format); my $appssheet = $worksheet1->get_name(); print "APP Sheet name: $appssheet . \n"; my ( $row_min, $row_max ) = $worksheet1->row_range(); my ( $col_min, $col_max ) = $worksheet1->col_range(); for $row ( $row_min .. $row_max ) { for my $col ( $col_min = 0) { if ( $appssheet eq $appsshhetname ) { my $cell = $worksheet1->get_cell( $row, 0 ); next unless $cell; $cellA = $cell->value(); #$cellA =~ s/@(.*)//g; $cellA =~ s/@(AD.ABC.COM)//g; if ( $cellA=~ /(\d{9})/ ) { push @cellA, $cellA; #print "DUMP: @cellA"; } } #print "$cellA \n"; } } %params = map { $_ => 1 } @cellA; print Dumper %params; if ( $appssheet eq $ADdata ) { for my $row1 ( $row_min .. $row_max ) { for my $col1 ( $col_min = 0) { my $cellB = $worksheet1->get_cell( $row1, 0 ); next unless $cellB; $cellC = $cellB->value(); #$cellC =~ s/@(AD.ABC.COM)//g; print "2nd Entry :$cellC\n"; #push @cellC , $cellC; if(exists($params{$cellC})) { $worksheet->write($r, 0, $cellC); } } } $r += 1; }

In reply to Unable to compare 2 arrays from 2 separate columns of separate sheets. by chandantul

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.