<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><DIV>Hi folks,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Here's another one of those 'it should be easy' scenarios. Again, I would appreciate your help.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>This time, I've got a borrowed 'chomp' regex (chomp behaves in exactly the same way). But, instead of chopping off the last character in the string, it returns the value '1'.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I can only guess that this is because Perl is working in 'list mode', not in 'paragraph mode' (see <A href="http://perldoc.perl.org/functions/chomp.html">here</A>), which makes sense because the file it is reading from is a list. And its chopping off 1 character (the new line character).</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Please tell me how to get Perl doing the right thing here. I am going to need to get it right for my 7 million line long arrays in future. I could resort to substr, but that's not as efficient (apparently), and I've got to get to grips with regexes anyway.</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>I enclose the relevant code. PERRMOSS_Control_File.txt needs to be in the same directory as Input_file_chomp.pl.</DIV><BR><DIV> <SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><SPAN class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Lucida Grande; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><DIV>Regards,</DIV><DIV>Martin</DIV><DIV>Visit my website...</DIV><DIV><A href="http://web.mac.com/martin_jacobs1"><SPAN class="Apple-style-span" style="color: rgb(0, 0, 238); -khtml-text-decorations-in-effect: underline; ">http://web.mac.com/martin_jacobs1 </SPAN></A></DIV><BR class="Apple-interchange-newline"></SPAN></SPAN></SPAN> </DIV><DIV><SPAN></SPAN></DIV></BODY></HTML>