On Thu, 13 Nov 2003 01:07:45 -0500, Michael Higgins wrote:
map { $total += $_=~m#[\r\f]+#g } @data;
This won't do what I think you want it to do. m//g in scalar context will match once or not a t all, but never mutliple times, even if it could match more than once. I think dropping the /g wouldn't affect the result, in this case.
This might produce better results ("$_ =~ " is superfluous):
map { $total += () = m#[\r\f]+#g } @data;
Apart from the "+", which confuses me a little, you also could try out the tr/// operator:
map { $total += tr#\r\f##d } @data;
Yes, thanks. My questions weren't really about perl code, per se, but about the .dbf file... I trimmed and neatened the regex, yes.
As for DBD::??? returning different values, in the end, I dropped the index, using 'XBase' directly, and got exactly 2 occurances of \r in the entire database.
Proved to be old records from the original database which was, sadly, converted via msword for the mac (no joke) to... filemakerpro and ported(?) to windows -- and some years later (several years ago) converted to a foxpro format.
(None of which involved me but for squawking at the poor results which have proved probematic ever since -- though I have a bit more sympathy now `-| ).
So, no suprise then, and, most importantly, not my doing. And as there are only two, I'll have someone fix the records manually. ;-)
Thanks again for your reply.
-- mike higgins
