in reply to Re: Adding text file data to hashes and array
in thread Adding text file data to hashes and array

Two nits: Why use splice @lines, 0, 1; instead of shift, and why use split /\s+/ when split ' ' does the same thing but discards leading whitespace? splice @elements, 0, 1; discards the first element regardless of what it contains, even if the file format changes and there is no more whitespace at the front of the lines.

Replies are listed 'Best First'.
Re^3: Adding text file data to hashes and array
by thanos1983 (Parson) on Feb 18, 2019 at 11:45 UTC

    Hello haukex,

    Yes you are right, I was not thinking clearly on that day and I made the code more complex without any reason :).

    Thanks for pointing out minor possible improvements.

    BR / Thanos

    Seeking for Perl wisdom...on the process of learning...not there...yet!