title: Perl nested loops
body: <p>I have a text file with the following contents:</p>
  
  <pre><code>NW1 SN1 DEV1
  NW2 SN1 DEV2
  </code></pre>
  
  <p>I wrote a Perl script to iterate over the file, but it is running only once. The code is:</p>
  
  <pre><code>open(INPUT1,"input.txt");
  @input_array = &lt;INPUT1&gt;;
  
  for($i=0;$i&lt;@input_array;$i++)
  {
      my ($ser,$node,@dev)=split(/ +/,$input_array[$i]);
  
      for($x=0;$x&lt;@dev;$x++)
      {
          print("Hi");
      }
  }
  </code></pre>
  
  <p>The script is iterating for the first line but not iterating for second line.</p>