Also, note the following:
1. If the words in your input file are separated with multiple spaces, replace
-
my ($scan_op,$ch_num,$mask_bit) = split (/ /,$one);
-
with:
-
my ($scan_op,$ch_num,$mask_bit) = split (/\s+/,$one);
-
2. There is no need of using a while loop to read from the file and push the lines to an array. You can directly use:
-
@arr_msff = <INP1>;
-
@arr_pat = <INP2>;
-