Can someone tell me the mistake I am doing here?
Unlikely, because it isn't self-contained. You are reading 1 set of input from the INPUT_FILE handle (which I'm guessing corresponds to the sample input you have provided) and 2 other sets of input from the REPLAY_FILE handle which have not been provided to us. Without an SSCCE, the my best guess is that you don't really want a regex match at if ($rpl_sub =~ /^$line/) but rather a substring match.
See the Basic Debugging Checklist for how you can help yourself. Good luck.
In reply to Re: Trying to read print in a loop inside a subroutine
by hippo
in thread Trying to read print in a loop inside a subroutine
by kaushik9918
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |