in reply to Re^8: writing two files (different in length) to one output
in thread writing two files (different in length) to one output

while ( (print "Prompt: "), $line=<STDIN>, $line !~ /^\s*Q(uit)\s*$/i )

Having spent 5 minutes looking at this one line I'm still stumped as to the purpose of the capture group in the regex. Can you explain the purpose? ie. why would /^\s*Quit\s*$/i not perform exactly the same in your given code (since you have not subsequently referred to the captured data)? Thanks.

Replies are listed 'Best First'.
Re^10: writing two files (different in length) to one output
by Marshall (Canon) on Jun 01, 2017 at 18:30 UTC
    You spotted a missing ? to make (uit) optional. Should be:
    while ( (print "Prompt: "), $line=<STDIN>, $line !~ /^\s*Q(uit)?\s*$/i + )
    That way both the single letter q,Q or the full word Quit works. I just made a typing goof and didn't fully test, otherwise I would have seen that a simple "q" didn't work.