in reply to Re: Extract a column of csv
in thread Extract a column of csv

Hey

thank you for helping out , I have just one question that here in line

 print $row->[1], "\n";

our 1 is fixed but i want to extract multiple columns , so I wrote a subroutine

sub column_segregation { my $o=$_[0]; print "$o \n"; my @array_A2=(); my $csv = Text::CSV->new ({ binary => 1 }); while (my $row = $csv->getline($io)) { push @array_A2, $row->[$o]; } return (@array_A2); }

but here $o is changing but it constantly returns the same array , which is at location 2. can you please tell me what is wrong in my code