Here is another set of my final assignment This is my final assignment. I have been given a fixed length employee list below. ABAD, RACHEL PR CLERK ENGINEERING ENGR DIST OFC (818) 374-7538 ABDULLAH, SOLOMON SAFETY ENGR PRESS VES INSPECTION (818) 374-9930 ABEL, DARLA SR SAFETY ENG ELEVATORSINSPECTION (213) 202-9839 ABRAHAM, TERESA SR MGMT ANALYST II RES MGMT CUST (213) 482-6766 ABRAMYAN, DANIEL INACTIVE NONE NONE ABREU, JAMES BUILD MECH INSPECTORCODE ENFCMNT (818) 374-9862 ACEVEDO CASTRO, MECH ENGRG ASS ENGINEERING (213) 202-9902 ACOSTA, JESUS GEOTECH ENGINEER II INSPECTION GRADING (213) 482-6967 AGHAZARIAN, SAKO SRBUILD INSPECTOR INSPECTION BLDG(213) 482-0372 Also I have been given a second list of phone numbers, which happen to be on the list of employee list. (818) 374-9930 (213) 202-9902 (213) 482-0373 (818) 374-7538 If there is a match, I need to extract and printout the entire line (to another file) but for now I am testing check to ensure am able to read the hash.. !/usr/bin/perl use strict; use warnings; open PHONELIST, "< PHONELIST.TXT" or die "could not open PHONELIST.TXT\n"; my $phone_no; while (<PHONELIST>) { chomp; $phone_no->{$_} = 1; print "$phone_no\n"; } close PHONELIST; open EMPRECORD, "< EMPRECORD.TXT" or die "could not open EMPRECORD.TXT\n"; while (<EMPRECORD>) { chomp; my ($phoneKey) = ($_); if (defined $phone_no->{$phoneKey}) { print STDOUT "$_\n"; } } close EMPRECORD; I am unable to create the hash to read and compare. Please advise what I am doing wrong.

In reply to Data Manipulation by kume8sit

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.