Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister

Re: Writing issue in excel after comparing arrays.

by choroba (Archbishop)
on Feb 11, 2021 at 17:13 UTC ( #11128243=note: print w/replies, xml ) Need Help??

in reply to Writing issue in excel after comparing arrays.

Your code makes no sense. Please, as pleaded previously, try to provide a SSCCE.
  1. Array::Comapre is not Array::Compare.
  2. $@array1[$l] causes a syntax error.
  3. Without the context, we have no idea what the values of all the variables are.
But, if I run the following code:
#!/usr/bin/perl use strict; use warnings; use feature qw{ say }; use Array::Compare; my $comp = Array::Compare->new; my @array1 = qw( 999991 999992 999993 999994 ); my @array2 = qw( 999991 999992 999993 999994 999995 ); if ($comp->compare(\@array1, \@array2)) { say "Arrays are the same"; } else { say "Arrays are different"; }
I'm getting
Array are different
as expected.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Writing issue in excel after comparing arrays.
by chandantul (Beadle) on Feb 11, 2021 at 20:11 UTC

    This issue was resolved by below code. Thanks

    if ($cell[$x] ~~ @cell1) {...}</
      Note that the smartmatch operator is experimental and its behaviour might change in future versions of Perl.

      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

        Ah, but don't worry. When it does change they'll still be completely clueless and will post more poorly worded questions with non-compiling source which can't be used to replicate their problem.

        (*OP plonk*)

        The cake is a lie.
        The cake is a lie.
        The cake is a lie.

      I might be thick...but...I fail to see how that solves any of your problems...

      Edited to correct typo...

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11128243]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2021-04-14 08:06 GMT
Find Nodes?
    Voting Booth?

    No recent polls found