# 2 QUESTIONS **** I aM NEW ON PERL!ANYONE CAN SLOVE THIS PROBLEM???

## ilikematurewoman — 2003-11-25 19:20:01

    Problem 1

    Suppose you are given a datafile which consists of (name, telephone

    number) pairs on each line. An example of datafile is shown below:

    all 212-212-3333 veil 216-888-3322 hulya 212-231-8218

    Write a PERL program called rehber which reads the datafile and then

    prompts the user for a name. If a name is entered, then the telephone

    number of the person (if it exists) will be printed.   The input will

    be terminated by <ctrl-d>. When the program rehber is run as follows,

    you will get the following output:

    °/0 rehber datafile >

     >ali all's number is   :   212-212-3333

    >	hulya

     hulya's number is : 212-231-8218

     >	ahmet

     ahmet does not exist in the directory

     >	<ctrl-d>

     ********************************************************

    PROBLEM 2

    ------------

    Write a perl program called mysearch which accepts a string followed

    by a list of files on the command line. The program will then search

    (using case insensitive search) each file for the occurrence of the

    string an print file name and line number of where the string occurs.

    As an example consider the following:

    % mysearch    all datal data2 dataS datal:2 datal:5 data3:1 data3:3

    What the above command did is search the datal, data2 and dataS files

    in the current directory. If a line with the substring all is found,

    then the filename followed by the line number is printed. NOTE: your

    search should be case insensitive.