Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>First, you should always have <a href="https://stackoverflow.com/questions/8023959/why-use-strict-and-warnings">'use strict;' and 'use warnings;' pragmas in your script</a>.</p> <p>It seems like you need a simple array (<code>@param_name</code>) for reference, so loading those values would be straight forward as you have it. (again, adding the above pragmas would start showing you errors, including the <code>$line = =~ s/^\s+//;</code> line!) </p> <p>I suggest you read this, to understand how you can load your data file into a <a href="http://perldoc.perl.org/perldsc.html#HASHES-OF-HASHES" rel="nofollow noreferrer">Hash of Hashes</a>. Once you've designed the hash, you simply read and load the file data contents, and then iterate through the contents of the hash. </p> <p>For example, using time as the key for the hash</p> <pre><code>%HoH = ( 1 =&gt; { name =&gt; "Param1", ty =&gt; "UI", value =&gt; "5", }, 2 =&gt; { name =&gt; "Param3", ty =&gt; "TXT", value =&gt; "Some Text 1", }, 3 =&gt; { name =&gt; "Param1", ty =&gt; "UI", value =&gt; "10", }, ); </code></pre> <p>Make sure you close the INFILE after reading in the contents, before you start processing.</p> <p>So in the end, you iterate over the hash, and reference the array (instead of the file contents) for your output writes - I would imagine it would be <strong>much</strong> faster to do this.</p> <p>Let me know if you need more info.</p> <p>Note: if you go this route, include <a href="http://perldoc.perl.org/Data/Dumper.html/" rel="nofollow noreferrer" title="Data::Dumper">Data:Dumper</a> - a significant help to printing and understanding the data in your hash!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload