Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Writing issue in excel after comparing arrays.

by choroba (Cardinal)
on Feb 11, 2021 at 17:13 UTC ( [id://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 (Scribe) 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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2024-03-28 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found