I've blabbered about this enough, here's some example code I ran just now.

The script:

----------start----------
use strict;
use warnings;

use DBI;
use Data::Dumper;

#Test of DBD::DBM with MLDBM
#MLDBM file format is $Dbm{ $id } = {key => $val, key2 => $val2 };

my $dbh = 
DBI->connect('dbi:DBM:mldbm=Storable;type=DB_File;f_dir=/home/sappy/public_html');
$dbh->{RaiseError} = 1;
$dbh->{dbm_store_metadata} = 0;

#Except for 'id', each column in dbm_cols corresponds
#to keys from the hashrefs in the MLDBM file
$dbh->{dbm_cols} = 'id,path,publication_name,regex_headlines';


my $statement = $dbh->prepare('SELECT
id,path,publication_name,regex_headlines FROM sites WHERE id=?');
$statement->execute('id_services-http-users-r-ryantate-cgi-bin-se_ho_admin-23362-1058765796-14\
70540404-3232250416');
my @row = $statement->fetchrow_array;
print Dumper(@row);

----------end----------

What I expected as output was an array of four defined, simple scalar
values, corresponding to $id ("id_services ..."), $Dbm{$id}{path}
("/index.html"), $Dbm{$id}{publication_name} ("Dude's Site"), etc.

What I got as output from this test script was $id, a hashref
comprising the entirety of $Dbm{$id}, and two undefined values. More
precisely:

----------start----------
$VAR1 = 
'id_services-http-users-r-ryantate-cgi-bin-se_ho_admin-23362-1058765796-1470540404-323\
2250416';
$VAR2 = {
   'match_join_exclude_target' => '',
  'match_num_year' => [
    '3'
  ],
  'search_target_exact_phrase_atom_handling' => 'Match whole exact phrase',
---snip---
  'path' => '/index.html',
---snip---
  'publication_name' => 'Dude's Site',
---snip---
  'regex_headlines' => '<h3>[A-Za-z]+?, ([A-Za-z]+?) (\\d\\d?),
(\\d\\d\\d\\d)</h3>\\s*<div cl\
ass="blogPost">\\s*(.{1,20})(.*?)\\s*<div class="byline">Posted by: <a
href="([^"]+)">',
 'regex_exclude_list' => [],
  'next_page_increment_flag' => ''
};
$VAR3 = undef;
$VAR4 = undef;
----------end----------

Short of patching the module, is there anything I can do to get what I expected?

Reply via email to