in reply to How to display first line of each record using the question code

Hi,

I just tried Rolf's code, and it did not seem to work properly for me, although it looks correct.

Then I realized that copying and pasting from Windows to Cygwin was probably the problem. So I changed Rolf's code as follows:

local $/="__data__\r\n";

And then it works and does what is expected

Maybe it is all what you need to do.

  • Comment on Re: How to display first line of each record using the question code
  • Download Code

Replies are listed 'Best First'.
Re^2: How to display first line of each record using the question code
by Anonymous Monk on May 18, 2013 at 19:33 UTC

    Prior to starting this thread, the OP had posted multiple questions on stackoverflow for this exact issue and was given multiple working alternatives. It's unclear to my why this tread was started.

    It appears that each of the solutions broke the OP's cardinal rule by not using his broken code.

      > It's unclear to my why this tread was started.

      His style reminds me of a troll like regular here who constantly shifts identities and denies collaboration.

      Beware of your hand while feeding! =)

        I just wanted to say the problem was with the data file having \r\n that was created on a windows system and later copied over to a unix systems. Using notepad++, I was able to search \r\n and replace with \n ... I would like to thank everyone for understanding the problem and support..