itmajors has asked for the wisdom of the Perl Monks concerning the following question:
I'm having trouble with this simple script, it's not running it gives me an error Can't locate object method "getline" via package "IO::Handle" at update.cgi line 10
What I'm doing wrong here...
#!/usr/bin/perl # -------------------------------------------- print "Content-type: text/html\n" ; print "Pragma: no-cache\n\n"; use Text::CSV_XS; $id = "832333"; $in{'p_address_2'} = "Test 123"; my $fh = Text::CSV_XS->new({ binary => 1, sep_char => '|', eol => "\n" +}); open my $csv, "<", "./Admin/data/bims-properties.db" or die "./Admin/d +ata/bims-properties.db: $!"; while (my $row = $csv->getline($fh)) { if ($row->[0] eq $id) { $row->[8] = $in{'p_address_2'}; print qq~ $row->[8]~; } $csv->print($out, $row); } close $fh or die "./Admin/data/bims-properties.db: $!"; print qq~ end~; exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: FLAT FILE Pipedemimited
by Anonymous Monk on Jul 24, 2014 at 00:33 UTC | |
|
Re: FLAT FILE Pipedemimited
by GotToBTru (Prior) on Jul 24, 2014 at 20:11 UTC |