I am trying to use DBD::CSV to read a file with semicolon delimited.

Data looks like:

Date;Time;Station;Frq;Mode;Pwr;Conf;Sent;Rcvd;End;Name;QTH;Remarks;S;R +;DXCC;STX;SRX;Mult;Pts;ITU;CQ;ContID;Pfx;Cont;Freq;RXpwr;State;Prov;C +ounty;QSL Via;Age;Grid;QslRdt;QslSdt;Sect;Iota;Prop;Qslmsg;Satmod;Sat +nm;Tenten;Addr;Notes;Submode;DOK;OBL;JCC;JCG;BandRX;QRP;SWL;Cmpl;QSO# +;Lat;Lon;eqslS;eqslR;eqslS_Dt;eqslR_Dt;lotwS;lotwR;lotwS_Dt;lotwR_Dt; +Rig;Az;El;Eq;FI;MB;MSSH;Bursts;Pings;Op;Stn;Ownr;Sig;SigInf;Key;Confi +g;Email;S_via;R_via;Q;ud1;ud2;Sp4;Sp3;Sp2;Sp1 2005-10-29;21:34:00;VC3O;14;SSB;;MWB;59;59;;;;;N;N;1;4;4;;;12;09;;VC3; +NA;;;;;;;;;;;;;;;;;;;;;;;;;;0;; ;0001;;;Y;Y;;;Y;N;;;;;;;N;;;;;;;;;;;; +;E;;N;;;;;; 2005-10-29;21:41:00;NY1Q;14;SSB;;MWB;59;59;;;;;N;N;291;4;5;;;8;5;;NY1; +NA;;;RI;;Washington;;;;;;;;;;;;;;;;;;;;;0;; ;0002;;;Y;N;;;Y;N;;;;;;;N +;;;;;;;;;;;;;;;N;;;;;; 2005-10-29;21:47:00;NQ4I;14;SSB;;MWB;59;59;;;;;N;N;291;4;5;;;8;;;NQ4;N +A;;;GA;;Spalding;;;;;;;;;;;;;;;;;;;;;0;; ;0003;;;Y;N;;;Y;N;;;;;;;N;;; +;;;;;;;;;;;;N;;;;;; 2005-10-29;21:57:00;K3LR;14;SSB;;MWB;59;59;;;;;N;N;291;4;5;;;8;5;;K3;N +A;;;PA;;Mercer;;;;;;;;;;;;;;;;;;;;;0;; ;0004;;;Y;Y;;;Y;Y;;2006-04-14; +;;;;N;;;;;;;;;;;;;E;;N;;;;;;


Code:
#!/usr/local/bin/perl use strict; use warnings; use DBI; my $dbh DBI->connect('dbi:AnyData(RaiseError=>1):','csv_sep_char=\;'); $dbh->func( 'callsigns', 'CSV', 'C:\\Documents and Settings\\My Documents\\MyProjects\\Pa +rsingXML\\log.jdb', 'ad_catalog'); my $sth = $dbh->prepare("SELECT Station, Date, Time FROM callsigns"); $sth->execute(); while (my $row = $sth->fetch) { print "@$row\n"; }

and I get the following error messages when the program runs and obviously do not understand them:

Execution ERROR: Can't use string ("CAN'T FIND COLUMN NAMES ON FIRST") + as an ARR AY ref while "strict refs" in use at C:/Perl/site/lib/AnyData.pm line +126, <GEN0 > line 2. . DBD::AnyData::st execute failed: Execution ERROR: Can't use string ("CAN'T FIND COLUMN NAMES ON FIRST") + as an ARR AY ref while "strict refs" in use at C:/Perl/site/lib/AnyData.pm line +126, <GEN0 > line 2. . [for Statement "SELECT Station, Date, Time FROM callsigns"] at C:\DOC +UME~1\N7DQ \MYDOCU~1\MYPROJ~1\PARSIN~1\TEST-C~1.PL line 13. DBD::AnyData::st execute failed: Execution ERROR: Can't use string ("CAN'T FIND COLUMN NAMES ON FIRST") + as an ARR AY ref while "strict refs" in use at C:/Perl/site/lib/AnyData.pm line +126, <GEN0 > line 2. . [for Statement "SELECT Station, Date, Time FROM callsigns"] at C:\DOC +UME~1\N7DQ \MYDOCU~1\MYPROJ~1\PARSIN~1\TEST-C~1.PL line 13. C:\Documents and Settings\N7DQ\My Documents\MyProjects\ParsingXML>



Any ideas what I am doing wrong?

Thanks
Mike

20060727 Janitored by Corion: Added formatting, code tags, as per Writeup Formatting Tips


In reply to Problem parsing semicolon delimited file with DBD::CSV by sxmwb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.