I need to get a specific field from a CSV file and put it in an array. I am not sure how to do this. This is what I have tried so far.
#!/usr/bin/perl
use strict;
use warnings;
my @array = <>;
my @fields = split ",", @array;
print @fields[2];
This is an example of the CSV file
9988,Kathleen,Brown,kbrownc@goo.gl,OH,Female,Italian
9989,Antonio,Ford,afordb@bigcartel.com,IL,Male,
9990,Diana,Banks,dbanksa@jalbum.net,MA,Female,English