title: Reading a single column from csv using perl
body: <p>file has data like this:</p>
  
  <pre><code>S_No        S_Name          Acc_Num     Total_Amount
  1            Larry            1521          18000           
  </code></pre>
  
  <p>To read a column from <code>csv</code> for this purpose I wrote this script:</p>
  
  <pre><code>#!/usr/bin/perl -w
  use strict;
  use warnings;
  
  use Text::CSV;
  my$column_separator = qr/,/;
  my $column_number = "3";
  my$file = "/home/Admin/Documents/new (copy).csv";
  open(my$FILE,"&gt;&gt;","$file") or die "$!";
  while (&lt;$FILE&gt;){
    my @columns = split(/$column_separator/);
    print $columns[$column_number] ,"\n";
  }
  close $FILE;
  </code></pre>
  
  <p>But this script is throwing an error.</p>
  
  <pre><code>Use of uninitialized value in print at another.pl line 12, &lt;$FILE&gt; line from 1 to 11..
  </code></pre>
  
  <p>how to resolve this error?</p>