Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: DBD::CSV failing

by bmann (Priest)
on Jan 28, 2006 at 02:08 UTC ( #526123=note: print w/ replies, xml ) Need Help??


in reply to Re: DBD::CSV failing
in thread DBD::CSV failing

Single quotes don't interpolate and there is no literal \n in your password file.

Try changing the single quote to double quotes:

'eol' => '\n', should be 'eol' => "\n",


Comment on Re^2: DBD::CSV failing
Select or Download Code
Re^3: DBD::CSV failing
by bsdwolf (Initiate) on Jan 28, 2006 at 02:31 UTC
    Well, I guess I must have tripped on that, because I have all delimited stuff in double quotes and it Just Sorta Works now.

    Thanks for your help!

    --*greywolf;
    /* relayer halo gmail */
      It's not a matter of whether "the delimited stuff" is in double quotes. The fields in the data don't need to be in double quotes unless they have embedded newlines or commas or double quote characters. The field separator ';' doesn't need to be in double quotes because it's a single literal character. The only thing that *needs* to be in double quotes is the "\n" beacues as bmann++ #good eye, correctly pointed out, otherwise it will expect there to tbe a literal slash followed by a literal 'n' and the end of all your records.
        Okay, I'm back (again). Using $sth->fetchrow_hashref seems to be solving my problem. I have discovered that one cannot use $sth->fetch if one chooses to execute a query containing conditionals based on fields; i.e.
        $sth->prepare("SELECT * FROM db WHERE field < 2000"); while (@row = $sth->fetch) { ... }
        will return the first row and then nothing beyond that. If I use
        while ($row = $sth->fetchrow_hashref) { ...
        for some reason, everything seems to be hunky dory. Also, that "undef" in setting up the column names and variable references also is wont to cause me difficulty ("perldoc DBD::CSV" for reference on that one). Go figure.
        --*greywolf;
        /* relayer halo gmail */

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://526123]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2014-09-24 01:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (244 votes), past polls