title: Perl how to use variable in a string block with << Parameter
body: <p>I try to use a variable i inside the <code>&lt;&lt;</code> block. But it fails because of the compilation errors</p>
  
  <blockquote>
    <p>Global symbol "$i_0" requires explicit package name at
    D:/development/perl/SupportCases/createFTL.pl line 76.<br>
    Global symbol "$i_0" requires explicit package name at
    D:/development/perl/SupportCases/createFTL.pl line 76.<br>
    Global symbol "$i_1" requires explicit package name at
    D:/development/perl/SupportCases/createFTL.pl line 76.<br>
    Global symbol "$i_1" requires explicit package name at
    D:/development/perl/SupportCases/createFTL.pl line 76.<br>
    Global symbol "$i_2" requires explicit package name at
    D:/development/perl/SupportCases/createFTL.pl line 76.<br>
    Global symbol "$i_2" requires explicit package name at
    D:/development/perl/SupportCases/createFTL.pl line 76.<br>
    Global symbol "$i_0" requires explicit package name at
    D:/development/perl/SupportCases/createFTL.pl line 76.<br>
    Global symbol "$i_1" requires explicit package name at
    D:/development/perl/SupportCases/createFTL.pl line 76.<br>
    Global symbol "$i_2" requires explicit package name at
    D:/development/perl/SupportCases/createFTL.pl line 76.</p>
  </blockquote>
  
  <p>How do I have to define the variables inside the &lt;&lt; block? </p>
  
  <p>Thanks</p>
  
  <pre><code>my $i = 1;
  for ($i = 1; $i &lt;=6; $i++){
  
  my $block = &lt;&lt;BLOCK;
      &lt;#if ((model.fields.txt_Artikel_Z$i?? || model.fields.txt_Artikel_Z$i.value = "") &amp;&amp; 
                  (model.fields.txt_Artikelnummer_Z$i?? || model.fields.txt_Artikelnummer_Z$i.value = "") &amp;&amp;
                      (model.fields.txt_Anzahl_Z$i?? || model.fields.txt_Anzahl_Z$i.value = "") &amp;&amp;
                          (model.fields.chk_Ware_aus_Z$i_0?? || model.fields.chk_Ware_aus_Z$i_0.value = "") &amp;&amp;
                              (model.fields.chk_Ware_aus_Z$i_1?? || model.fields.chk_Ware_aus_Z$i_1.value = "")&amp;&amp;
                                  (model.fields.chk_Ware_aus_Z$i_2?? || model.fields.chk_Ware_aus_Z$i_2.value = "")) 
                                  &amp;&amp;
                          (!(model.fields.txt_Artikel_Z$i.value = "") &amp;&amp; 
                                  !(model.fields.txt_Artikelnummer_Z$i.value = "") &amp;&amp;
                                      !(model.fields.txt_Anzahl_Z$i.value = "") &amp;&amp;
                                          !(model.fields.chk_Ware_aus_Z$i_0.value = "") &amp;&amp;
                                              !(model.fields.chk_Ware_aus_Z$i_1.value = "")&amp;&amp;
                                                  !(model.fields.chk_Ware_aus_Z$i_2.value = ""))                                                                                              
          &gt;
          &lt;#else&gt;
              &lt;result type="ERROR" 
                  field="txt_Fehlerbericht_Arbeiten_Z$i"
                  code="-1" 
                  message="Komplette Zeile $i muss ausgefüllt sein!" /&gt;
  
          &lt;/#if&gt;
  BLOCK
  
  print "$block";
  
  }
  </code></pre>