Dear 2Teez,

I've been trying to solve my little programming problem using the module, however, due to my lack of experience, I somehow have not been able to run the comparison properly

What I did not understand in the CPAN description was the fact that only one array is used for the comparison, e.g.

diff \@a, $b { STYLE => "Table" };

I would have expected to have two @arrays for comparision, e.g.

my @xml_files = glob( '*xml' ); #say for @xml_files; my @bak_files = glob( '*bak' ); #say for @bak_files; #using the Text::Diff::Table for comparison my $format = ""; my @joint_files = @xml_files, @bak_files; my @results = diff \@joint_files, $format { STYLE => "Table" }; say for @results;

However, I am getting the following error message, saying that the module is not install properly

C:\dev>perl comparing_files_3_using_text_diff.pl ./file_compare_on_lis +ts Can't locate package Text::Diff::Base for @Text::Diff::Table::ISA at c +omparing_f iles_3_using_text_diff.pl line 4. Backslash found where operator expected at comparing_files_3_using_tex +t_diff.pl line 20, near "diff \" (Do you need to predeclare diff?) syntax error at comparing_files_3_using_text_diff.pl line 20, near "di +ff \" Global symbol "%format" requires explicit package name at comparing_fi +les_3_usin g_text_diff.pl line 20. Global symbol "@results" requires explicit package name at comparing_f +iles_3_using_text_diff.pl line 22.

I suppose I have to use the module as is, but what does $b represent and why can't it be changed to $format?

Could somebody give me a hint why I am getting the error message despite the module being installed?

I am confused about these package name declaration, I thought I did everything by the book

Thanks a mil in advance for your support

Kind regards

C.

In reply to Re^6: comparing contents of two arrays and output differences by PitifulProgrammer
in thread comparing contents of two arrays and output differences by PitifulProgrammer

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.