sub Loader{ my $Data = shift; my $file = shift; ## I declare the Text::xSV object my $XSV = Text::xSV->new(); my $question_number; my $length; my $f; my @Sorter=(); ## I set my separator here, otherwise it ## defaults to a comma. $XSV->set_sep("|"); open(FH,"$file")||die "Can't open $file: $!\n"; while(){ ## Here I get use the get_row method to retrieve ## the row, which also parses it. @Sorter = $XSV->get_row(); $question_number = shift @Sorter; $length = @Sorter; for($f = 0;$f < $length;$f++){ $Data{$question_number}[$f] = $Sorter[$f]; }#End of for loop }#End of while loop close FH; return $Data; }#End of sub