http://qs321.pair.com?node_id=314689


in reply to Re: Re: Re: DBD::CSV - how to install? (FTP only)
in thread DBD::CSV - how to install? (FTP only)

Hi again,
still struggling here, would appreciate it if someone could help me with the below code which fails.

The below code fails on the line:
$dbh->func( 'users', 'CSV', 'users.csv' 'ad_catalog');

Cheers!

-----------------

#!/usr/bin/perl -w use strict; require 'html.pl'; use lib './MyLib'; use DBI; my $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):'); $dbh->func( 'users', 'CSV', 'users.csv' 'ad_catalog'); my $sth = $dbh->prepare("SELECT surname FROM users"); $sth->execute(); while (my $row = $sth->fetch) { print "@$row\n"; } # define variables header(); print("<table width='90%'>"); print("<TR valign='top'><TD width='30%'>"); print ("Menu<BR>"); print ("====<BR>"); print ("<a href='create-user.cgi'>Create New User</a><BR>"); print ("Login User<BR>"); print ("User Admin<BR>"); print("</TD>"); print("<TD>"); print ("CREATE USER<BR>"); print ("==========<BR>"); print ("This is where the code to create new users will be place +d"); print ("<P>"); print ("USER VARIABLES<HR>"); my %user_data = qw( id blank first_name blank surname blank date_of_birth blank email blank password blank active blank last_login blank create_date blank earnings blank cash blank judoka_limit blank sensei_limit blank dojo_limit blank team_limit blank rank blank ); open (OUTFILE, ">./user_data/test_user"); while (($a, $b) = each(%user_data)){ print ("Key = $a and its value is $b<BR>"); print OUTFILE ("$a\n$b"); } close (OUTFILE); print ("<HR>USERS ON SYSTEM<HR>"); opendir(USERS, "./user_data"); while ( my $name = readdir(USERS)) { if ($name ne '.' and $name ne '..') { print ("<a href='./user_data/$name'>$n +ame</a><BR>"); } } closedir(USERS); print("</TR>"); print("</table>");
Kia Kaha, Kia Toa, Kia Manawanui!
Be Strong, Be Brave, Be perservering!