Path: utzoo!censor!geac!torsqnt!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!think.com!paperboy!hsdndev!rutgers!mcnc!uvaarpa!mmdf From: worley@compass.com (Dale Worley) Newsgroups: comp.lang.perl Subject: this program dumps core Message-ID: <1991Jan10.162134.24801@uvaarpa.Virginia.EDU> Date: 10 Jan 91 16:21:34 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: worley@compass.com Organization: The Internet Lines: 51 From: ruba@molbio.ethz.ch (Rudolf Baumann) #!/usr/bin/perl # format STDOUT = [etc.] . I cut out the program and ran it, and discovered a funny thing: Mailers sometimes turn lines that consist of '.' alone into '. ', but Perl doesn't accept trailing whitespace on the '.' that terminates a format! The patch below fixes this. (Whitespace is still not allowed *before* the '.', but that's visible.) Also, if you want advice on finding a bug, you should include the input that crashes the program. In this case, the record that the program is processing when it crashes isn't shown in the article! *** toke.c.orig Thu Jan 10 10:39:27 1991 --- toke.c Thu Jan 10 10:44:59 1991 *************** *** 2356,2364 **** str_nset(tmpstr, s, eol-s); astore(stab_xarray(curcmd->c_filestab), (int)curcmd->c_line,tmpstr); } ! if (strnEQ(s,".\n",2)) { ! bufptr = s; ! return froot.f_next; } if (*s == '#') { s = eol; --- 2356,2368 ---- str_nset(tmpstr, s, eol-s); astore(stab_xarray(curcmd->c_filestab), (int)curcmd->c_line,tmpstr); } ! if (*s == '.') { ! for (t = s+1; *t == ' ' || *t == '\t'; t++) ! /* empty */ ; ! if (strnEQ(t,"\n",1)) { ! bufptr = s; ! return froot.f_next; ! } } if (*s == '#') { s = eol; Dale Worley Compass, Inc. worley@compass.com -- Democracy attempts to upset nothing, but only to facilitate the potential upset of anything.