Yes, you missed at least a few things:

  1. Your data is already in rows and fields, so storing them (in the program) as an AoA, as is the output of Text::CSV_XS::csv() is actually the closest structure to your original. It does not make things more complicated. (I and others based this belief on your OP: "And here i get the problem: for example, the line from the file '\'asdasd', 'fghfghfgh' ")
  2. You are not the first programmer to have _'_ or _,_ in his data fields. Text::CSV_XS handles this (as does the universal CSV format) with quoting and escaping. Try reading the documentation for Text::CSV_XS which explains how to deal with your problem. For example you could use TAB as the field separator; CR already works as the record separator.
  3. In any case you would benefit from not having to write your own code to handle all possible combinations of characters and escape characters and double-escaped characters.
  4. Did you edit your post to state that you are planning to use alternate elements of the array as regexp to perform a substitution? I don't remember seeing that in your OP. If you did edit it, please make a note.
  5. If so, I hope you have been following the concurrent discussion on how to work with passing regexp into a program.
Good luck, nikolay!

The way forward always starts with a minimal test.

In reply to Re^3: do does not read massive containing element w/ ' sign. by 1nickt
in thread «Do» does not read an array containing element w/ «'» sign. by nikolay

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.