I have serious problems to understand the variables (like $sub) that have been used, in particular when we have the feature "substr".

substr() is a built-in function in perl. All of the built-in functions are documented and if your machine has the perl documentation installed you can simply run perldoc -f substr to read it. Alternatively, it is available online here.

also the variables -$#qual: why I have to write them like that?

$#qual is a special syntax, it returns the index of the last element in the array @qual. See the Arrays: A Tutorial/Reference for a discussion of this and many other aspects of using arrays in perl.

when I use warnings and diagnostics I have an error of unitialized value in operation that I can't really resolve

You can find the offending term and then surround it with a suitable "if" statement. Suppose $foo might sometimes be undefined, but you want to print it, you might then use:

if (defined $foo) { print $foo; }

or, equivalently

print $foo if defined $foo;

Perl is a very big language with lots to learn. I think you would benefit from reading some of the Tutorials here covering the areas that you know less well. Stick at it - you will soon be amazed at what you can achieve.


In reply to Re^3: explanation of passages of a Perl script by hippo
in thread explanation of passages of a Perl script by uuuiii

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.