[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl] Division by zero error from a regex



Hello all -

I'm trying to process a text file of Current Contents citations with
MacPerl. I'd appreciate any help here.

I'm working in "file slurp" mode. I'm trying to remove the extra authors
to convert lines like these:
Authors: Occelli ML
Authors: Biz S
Authors: Auroux A
Authors: Ray GJ

to:
Authors: Occelli ML; Biz S; Auroux A; Ray GJ

I'm trying to use this bit of code to set a placeholder for the first
author, remove the extra authors and replace the placeholder with
"Author: ". I'm operating on $_.

s/(Abstract: .*?)Author:/$1\nAUTHORXX/g;
s/ Author:/;/go;
s/AUTHORXX/Author: //go;

It works as expected if the final substitution is commented out, but it
chokes on that last line with:
# Illegal division by zero, <INF> chunk 1.

Thoughts, please.

Chris

-----------------------------------------------------
Christopher F. Blanford   V: 612/626-8036
180 Kolthoff Hall         F: 612/626-7541
207 Pleasant St SE        E: blanf001@tc.umn.edu
Minneapolis MN 55455      W: http://umn.edu/~blanf001
-----------------------------------------------------

PGP keyID: 356CC429  http://pgp.ai.mit.edu/



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org