Here is what i would do
1) open the datebook input file.
2) open 'raise' file for writing in append mode
3) Iterate through the input file.
4) split each line based on ':'. As i understood from the above example is that name, phone number, address, date and salary is seperated by ':'.
5) build a hash making name as key.
6) calculate 10% increment and add it to the salary.
7) print the values to the 'raise' file.
8) close both the file handles.
9) iterate through the hash for printing the names appeared more than once in input file.

You can refer the following untested code for more information.
#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my %seen = (); open(FH,">>raise.txt"); while(<DATA>) { my ($name, $phoneno, $address, $date, $salary) = split(/:/); next if $seen{$name}++; #$seen{$name}++; $salary += ($salary*10)/100; print FH "$name:$phoneno:$address:$date:$salary\n"; } close(FH); map { print "$_ appread $seen{$_} times in the file\n" if($seen{$_} > 1) +; }keys(%seen); __END__ Barbara Kerz:385-573-8326:832 Ponce Drive, Gary, IN 83756:12/15/46:268 +500 Barbara Kerz:385-573-8326:832 Ponce Drive, Gary, IN 83756:12/15/46:268 +500 Barbara Kerz:385-573-8326:832 Ponce Drive, Gary, IN 83756:12/15/46:268 +500 Norma Corder:397-857-2735:74 Pine Street, Dearborn, MI 23874:3/28/45:2 +45700 Norma Corder:397-857-2735:74 Pine Street, Dearborn, MI 23874:3/28/45:2 +45700 Tommy Savage:408-724-0140:1222 Oxbow Court, Sunnyvale,CA 94087:5/19/66 +:34200 Tommy Savage:408-724-0140:1222 Oxbow Court, Sunnyvale,CA 94087:5/19/66 +:34200 Lesle Kerstin:408-456-1234:4 Harvard Square, Boston, MA 02133:4/22/62: +52600 JonDeLoach:408-253-3122:123 Park St., San Jose, CA 94086:7/25/53:85100
console output
Barbara Kerz appread 4 times in input file JonDeLoach appread 2 times in input file Norma Corder appread 3 times in input file Lesle Kerstin appread 2 times in input file Tommy Savage appread 3 times in input file
raise file output
Barbara Kerz:385-573-8326:832 Ponce Drive, Gary, IN 83756:12/15/46:295 +350 Norma Corder:397-857-2735:74 Pine Street, Dearborn, MI 23874:3/28/45:2 +70270 Tommy Savage:408-724-0140:1222 Oxbow Court, Sunnyvale,CA 94087:5/19/66 +:37620 Lesle Kerstin:408-456-1234:4 Harvard Square, Boston, MA 02133:4/22/62: +57860 JonDeLoach:408-253-3122:123 Park St., San Jose, CA 94086:7/25/53:93610
Update: commented out one of the hash increments as mentioned by GrandFather

In reply to Re: Saving array duplicates, not using a hash? by lamp
in thread Saving array duplicates, not using a hash? by gctaylor1

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.