use DBI; $name = 'Testing'; $agency = 'TT'; $email = 'test@abc.com'; $org = 'ABC'; $mailstop = 'X159'; $phone = '(555) 123-4567'; $title = 'Other'; $DATA_COLUMNS = 'name,agency,email,org,mailstop,phone,title'; # tried it with/without the 'eadata' tag too (ie '/eadata/user/name' for the first one) $XML_COL_MAP = [ {'/eadata/user/name','name'}, {'/eadata/user/agency','agency'}, {'/eadata/user/email','email'}, {'/eadata/user/org','org'}, {'/eadata/user/mailstop','mailstop'}, {'/eadata/user/phone','phone'}, {'/eadata/user/title','title'} ]; # open a new connection to the XML file (user.xml) $dbh = DBI->connect('dbi:AnyData(RaiseError=>1):'); #$dbh->func('users', 'XML', './users.xml', {col_names => $DATA_COLUMNS, col_map => $XML_COL_MAP}, 'ad_import'); # XML file added below for ease of testing $dbh->func('users', 'XML', [], {col_names => $DATA_COLUMNS, col_map => $XML_COL_MAP}, 'ad_import'); #$dbh->func('users', 'XML', [], {col_names => $DATA_COLUMNS}, 'ad_import'); # insert a new record in to the memory table 'users' $SQL = qq{insert into users($DATA_COLUMNS) values('$name','$agency','$email','$org','$mailstop','$phone','$title')}; $dbh->do($SQL); # export out to a new file (users_new.xml) $dbh->func('users', 'XML', './users_new.xml', {col_names => $DATA_COLUMNS, col_map => $XML_COL_MAP}, 'ad_export'); #$dbh->func('users', 'XML', './users_new.xml', {col_names => $DATA_COLUMNS}, 'ad_export'); # getting this error (no matter which line above I try)): # SQL ERROR: Bad table or column name '1' starts with non-alphabetic character! # -- actually errors twice # close the database and closes the file $dbh->disconnect; # this is from the xml file (users.xml), places here for ease of testing __END__ Testing Tester LL test4@abc.net Test T125 98765 Other Walt Arsting... XX arsting...@xyz.net ASQ L339 555-123-4567