Thank you but that does unfortunately not help.
So firstly, one question, if I put the string into an array separated by a delimiter space, will reversing it reverse the characters itself as well? i thought this is only happening if it is a string, but not with a list? Hence if I print the array it is fine, we do not have to reverse to search for e.g. ylnoId.
Secondly, this was just an example of the string maybe a bad one. But the point is. I do not want to change much of the script as it seems to work fine. Except for that I am not able to parse the part in which the if statement is used. The right string is fed into the loop, but then the if statement is not executing. If you use
print Dumper \@reversedarray;
it works fine until i add the if statement. If you could help me on that i would be more than grateful.
If you have any further questions please do not hesitate to ask!

In reply to Re^2: regex - problem with the loop I believe or maybe the regex itself ? by trummelbummel
in thread regex - problem with the loop I believe or maybe the regex itself ? by trummelbummel

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.