Thank you for all the suggestions! This place never disappoints!

Since my seemingly unclear naming of the variables has come up a few times, I'll explain this a bit: the variables that are only used for 'calculating' have a short name, because they are only 'tools', not a part of the end result. For example my $sl is short for 'source length' - the length of the string that will be called my $source later on. Other example: my $de is short for 'destination end' - the index of the last character of what will become my $destination.

I feel a little bit silly because in a way, I already use the method that I was looking for (my $text = /blabla/), but I did not know I could actually fetch strings in a way that is understandable to me. I have done some searching before posting this, but all I found about this method is stuff that looks like /"(?>(?:(?>[^"\\]+)|\\.)*)"/. I am truly sorry about my noobieness, but when I see something like that, I can't help but think "What the hell am I staring at?"

On the other hand...

$text =~ /copying(.*)from/ or die "Couldn't find the pattern"; my $msg = $1;

... as suggested by Eily, this I understand and will be testing what I can do with it.

And finally, is it... is it worth trying Parse::RecDescent? Have gone through it and it looks like it might take some time to get my head around it, I do have some time, but I don't like spending time on something just to see it does not help at all. Have read through the thread linked by LanX and I can't help feeling a bit suspicious about the suggestion.


In reply to Re: Alternatives for index() ... substr() ? by zarath
in thread Alternatives for index() ... substr() ? by zarath

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.