in reply to Perl script to Parse a file for a string

wouldn't
if(condition){ .. } else{ ... }
within the while loop work? Except, I don't get the question you are asking.
Then why call the subroutrine within itself?
If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me

Replies are listed 'Best First'.
Re^2: Perl script to Parse a file for a string
by user786 (Sexton) on Jun 05, 2014 at 21:23 UTC
    "Then why call the subroutrine within itself?" Sorry,That was a mistake, I updated the code, I'm not calling within itself.