use Text::CSV_XS qw( csv ); my $aoh = csv ( in => "test.txt", encoding => "utf-8", headers => "auto", sep_char => "|", fragment => "row=3;6-9;15-*", ); say $aoh->[15]{Foo};