Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!samsung!uunet!mcsun!cernvax!chx400!bernina!biophys!ruba From: ruba@molbio.ethz.ch (Rudolf Baumann) Newsgroups: comp.lang.perl Subject: this program dumps core Keywords: format Message-ID: <6626@biophys.zir.ethz.ch> Date: 9 Jan 91 15:54:48 GMT Sender: news@biophys.zir.ethz.ch Lines: 104 I have gotten a database file from a Mac from which I want to make a nice printout with perl using formatted output. I can't find out why this simple program runs for the first five record and then dumps core. On a Sun4 the message is 'Segmentation fault' in csh and 'memory fault' in sh. (On a Sun3 it gives a 'Bus error'). The output of perl -v is: >This is perl, version 3.0 >$Header: perly.c,v 3.0.1.9 90/11/10 01:53:26 lwall Locked $ >Patch level: 41 The program: #!/usr/bin/perl # format STDOUT = Titel: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $titel ~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $titel Authors: ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $author ~~ ^<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $author Journal: @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<< $journal, $year . open(IN2, "dbfile"); $/ = ''; while () { @db = split('\|'); for ($i=3;$i<8;$i++) { $db[$i] =~ s/\n....//; $db[$i] =~ s/\n / /g; $db[$i] =~ s/ / /g; } $titel = $db[3]; $author = $db[4]; $journal = $db[6]; $year = $db[7]; write; } # --------------------------------------------------------------------------- and the dbfile looks like this: --------------------------------------------------------------------------- 1/4/1 FN- CURRENT CONTENTS ON DISKETTE| DT- Article| AN- BR86J| TI- Thyroid Peroxidase Autoantigen - Localization of Autoantigenic Epitopes on Recombinant Protein and Prediction of Secondary Structure.| AU- Banga, J.P.; Ewins, D.L.; Barnett, P.S.; Tomlinson, R.W.S.; Mahadevan, D.; Barton, G.J.; Sutton, B.J.; Saldanha, J.W.; Odell, E.; Mcgregor, A.M.| CS- JP Banga, Univ London Kings Coll, Sch Med, Dept Med, London WC2R 2LS, England| JN- Thyroperoxidase and Thyroid A; 207 () p351-358| PY- 1990| LA- English| 1/4/2 FN- CURRENT CONTENTS ON DISKETTE| DT- Article| AN- EH672| TI- Evidence for RNA-Oligonucleotides in Plant Vacuoles Isolated from Cultured Tomato Cells.| AU- Abel, S.; Blume, B.; Glund, K.| CS- S Abel, Martin Luther Univ, Sekt Biowissensch, Wissensch Bereich Biochem, Pflanzenbiochem ABT, Neuwerk 1, DDR-4020 Halle, Ger Dem Rep| JN- Plant Physiol; 94 (3) p1163-1171| PY- NOV-1990| LA- English| . . . --------------------------------------------------------------------------- The output looks like this: . . . Titel: Purification, Characterization, and Immunological Properties for 2 Isoforms of Glutathione Reductase from Eastern White Pine Needles. Authors: Anderson, J.V.; Hess, J.L.; Chevone, B.I. Journal: Plant Physiol; 94 (3) p1402-1409 NOV-1990 Titel: The Role of Inhibition of Pyruvate Kinase in the Stimulation of Gluconeogenesis by Glucagon - A Reevaluation. Authors: Haynes, R.C.; Picking, R.A. Journal: Arch Biochem Biophys; 283 (1) p51-59 NOV 15-1990 Titel: The Transition of the Higher-Order Structure of Rat Liver Chromatin Takes Place At About 85-Percent Neutralization of DNA Charges. Authors: Watanabe, F. Journal: Biochem Biophys Res Commun; 172 (3) p1129-1131 NOV 15-1990 Segmentation fault a printout without write (using only print) works on the whole file! Thank you Ruedi -- Rudolf E. Baumann ruba@molbio.ethz.ch Institut fuer Molekularbiologie & Biophysik ETH Hoenggerberg (HPM G6) MOLEKULA@CZHETH5A.bitnet CH-8093 Zuerich/Switzerland Tel. ++41 1 377 33 97