I get no errors. The code does create the file. (I mean to open and append... >> may be the wrong thing.)
Anyway here's the code:
#! /usr/bin/perl -w use strict ; #Adress Book Program #ver .01 #Lou Moran 01.28.02 my ($cat, $fname, $lname, $cname, $addr1, $addr2, $city, $state, $zip, + $wphone, $mphone, $hphone, $ophone, $bday, $anni, $email, $icq, $not +es) ; open (ADDRESS, '>> addbook.txt') or die "Can't open file; $!" ; while (<ADDRESS>) { print "Is this a Personal or Business contact? (Enter P or B)" ; my $perbus = <STDIN> ; chomp $perbus ; $perbus =~ tr/A-Za-z/a-z/ ; if ($perbus eq 'b'){ $cat = "Business" ; } else { $cat = "Personal" ; } print "Enter a first name: " ; $fname = <STDIN> ; chomp $fname ; print "Enter a last name: " ; $lname = <STDIN> ; chomp $lname ; print "Enter a company name: " ; $cname = <STDIN> ; chomp $cname ; print "Enter address information: " ; $addr1 = <STDIN> ; chomp $addr1 ; print "Enter address information: " ; $addr2 = <STDIN> ; chomp $addr2 ; print "Enter city: " ; $city = <STDIN> ; chomp $city ; print "Enter state (Use 2 letter abbreviation): " ; $state = <STDIN> ; chomp $state ; print "Enter Zip code: " ; $zip = <STDIN> ; chomp $zip ; print "Enter work phone: " ; $wphone = <STDIN> ; chomp $wphone ; print "Enter mobile phone: " ; $mphone = <STDIN> ; chomp $mphone ; print "Enter home phone: " ; $hphone = <STDIN> ; chomp $hphone ; print "Enter other phone: " ; $ophone = <STDIN> ; chomp $ophone ; print "Enter a birthday: " ; $bday = <STDIN> ; chomp $bday ; print "Enter an anniversary: " ; $anni = <STDIN> ; chomp $anni ; print "Enter email address: " ; $email = <STDIN> ; chomp $email ; print "Enter ICQ or AIM name: " ; $icq = <STDIN> ; chomp $icq ; print "Enter a note about the entry: " ; $notes = <STDIN> ; chomp $notes ; write ADDRESS ; } close ADDRESS or die "Can't close file; $!" ; format ADDRESS_TOP = AddressBook version 0.01 ___________________ ______________________________________________ +________ . format ADDRESS = @<<<<<<<<<<<<<<<<<< @<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< +<<<<<<<< "NAME", $lname, $fname "ADDRESS", $addr1 "ADDRESS", $addr2 "CITY", $city "STATE", $state "ZIP", $zip "WORK PHONE", $wphone "MOBILE PHONE", $mphone "HOME PHONE", $hphone "OTHER PHONE", $ophone "BIRTHDAY", $bday "ANNIVERSARY", $anni "EMAIL", $email "ICQ-AIM NAME", $icq "NOTE", $note "CATEGORY", $cat .
Any ideas?
--
ellem@optonline.net
There's more than one way to do it, just don't use my way.

In reply to Why does this code quit? by ellem

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.