Subject: | Not sure that it's really a bug, maybe I just couldn't get it to work |
Perl Version 5.6.0
Text:RecordParser version 0.02
Redhat 7.2 2.4.18-10
Simple 4 line "|" delimited file:
One|Two|Free|Four
Five|Six|Seven|Eight
Nine|Ten|Eleven|Twelve
Thirteen|Fourteen|Fifteen|Sixten
my $p = Text::RecordParser->new();
$p->filename("./test.txt");
$p->field_separator("|");
$p->bind_fields(qw[ field1 field2 field3 field4]);
my $record = $p->fetchrow_hashref;
print $record->{'Field1'};
this gives "Use of uninitialized value in print at test.pl line 10, <$fh> line 1."
If I change the access method to:
my $field = $p->extract("Field1");
print $field;
this gives "Invalid field Field1 for file './test.txt'.
Valid fields are: (Field1, Field2, Field3, Field4
I'm note sure if it's a bug or not, if not have I done something wrong?
Thanks,
Martyn