OK, fair enough; not being in control of the environment you're using is a good excuse for not using CPAN modules. Of course, as Athanasius points out, you can still install them locally for yourself: so if you merely need to write and run a script to do tasks assigned to you, I'd look into doing that. It's usually a good idea to not reinvent the wheel.

That said... the script you posted above does not compile:

$ perl 1120332.pl Global symbol "$m" requires explicit package name at 1120332.pl line 8 +2. Global symbol "$n" requires explicit package name at 1120332.pl line 8 +2. Execution of 1120332.pl aborted due to compilation errors. $

PLEASE, don't post code that doesn't compile.

Now, with this fixed, where are you having problems? Your script appears to be figuring out what keys/values were added removed between Switcher.properties and SwitcherNew.properties, so you got that part taken care of. That leaves output.

Exactly how do you want the final CSV file to be organized? Suppose that you'd be running this program with the sample data I used in Re^6: How to assign an array to a value in hash?. Can you post an example of what the output of the script for that data should look like? Also try to write some code that will output the data your script has collected in the format that you require.

For actually writing the file, I still recommend Text::CSV; this is not a core module, but you should be able to install it with the help of Athanasius' advice. Simply writing to a file with a ".csv" file extension, as you are doing now is not enough: CSV files are expected to adhere to a certain structure.

I hope this helps.


In reply to Re^14: How to assign an array to a value in hash? by AppleFritter
in thread Re: How to assign an array to a value in hash? by vukotid

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.