I posted this to question to the DBMan discussion forum last week and didn't get an answer. So, I thought I would give this forum a try.
I use DBMan for a news headline database. Double quotes are often used in headlines, and can appear at any place in the string.
In DBMan the add_record subroutine works fine and the double quotes in (Choosing the "Right" PC) are saved to the database. However, when or if the record is modified all data in the field after the first double quote is stripped.
I am not sure what to modify. I think it's in one of these subs?
############ get_record #################
# ...snip
LINE: while (<DB> ) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
$line = $_; chomp ($line);
@data = &split_decode($line);
next LINE if ($restricted and ($db_userid ne $data[$auth_user_field]));
if ($data[$db_key_pos] eq $key) {
$found = 1;
for ($i = 0; $i <= $#db_cols; $i++) {
$rec{$db_cols[$i]} = $data[$i];
}
last LINE;
}
}
# snip...
##############################
sub split_decode {
my ($input) = shift;
$input =~ s/\Q$db_delim\E$/$db_delim /o;
my (@array) = split (/\Q$db_delim\E/o, $input);
for ($i = 0; $i <= $#array; $i++) {
$array[$i] =~ s/~~/$db_delim/og;
$array[$i] =~ s/``/\n/g;
}
return @array;
}
I have checked perllop, Perl 5 by Example, and searched these forums to no avail. Any help will be greatly appreciated.
------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com
I use DBMan for a news headline database. Double quotes are often used in headlines, and can appear at any place in the string.
In DBMan the add_record subroutine works fine and the double quotes in (Choosing the "Right" PC) are saved to the database. However, when or if the record is modified all data in the field after the first double quote is stripped.
I am not sure what to modify. I think it's in one of these subs?
############ get_record #################
# ...snip
LINE: while (<DB> ) {
(/^#/) and next LINE;
(/^\s*$/) and next LINE;
$line = $_; chomp ($line);
@data = &split_decode($line);
next LINE if ($restricted and ($db_userid ne $data[$auth_user_field]));
if ($data[$db_key_pos] eq $key) {
$found = 1;
for ($i = 0; $i <= $#db_cols; $i++) {
$rec{$db_cols[$i]} = $data[$i];
}
last LINE;
}
}
# snip...
##############################
sub split_decode {
my ($input) = shift;
$input =~ s/\Q$db_delim\E$/$db_delim /o;
my (@array) = split (/\Q$db_delim\E/o, $input);
for ($i = 0; $i <= $#array; $i++) {
$array[$i] =~ s/~~/$db_delim/og;
$array[$i] =~ s/``/\n/g;
}
return @array;
}
I have checked perllop, Perl 5 by Example, and searched these forums to no avail. Any help will be greatly appreciated.
------------------
Larry "NgtCrwlr" Mingus
www.makeitsimple.com