in reply to Question on File Handler and Subroutines in Perl

You have several problems:

1. Your main call should be:

grep_file($_) for @ARGV; # ===
Update:Corrected per tobyink's recommendation, below.

This will call the grep for each file name.

2. Your "open file" should really be "Process_record" -- to process each record of each file.
The file is already open and read, before that is called.

3. I don't see any code to search through the file(s).

                As a computer, I find your faith in technology amusing.

Replies are listed 'Best First'.
Re^2: Question on File Handler and Subroutines in Perl
by tobyink (Canon) on Mar 05, 2019 at 12:53 UTC
Re^2: Question on File Handler and Subroutines in Perl
by Anonymous Monk on Mar 05, 2019 at 05:10 UTC
    Hi @NetWallah,

    Thank you so much for your patience in responding to my question.

    I have not tried to perform the pattern search; I thought of trying it later as I wasn't able to get the basics correct.

    Actually in the program above, I was thinking of the following:

    1. Read in file_list.txt which contains a list of files: a.txt, b.txt, c.txt.

    2. Open file_list.txt, and then open the individual files listed in file_list.txt.

    Thank you very much for your kind help! :)