in reply to Re: Re: Re: Can anyone figure how this works?
in thread Can anyone figure how this works?

thanks tachyon, that was really elaborate.

Now i know i made a mistake when extracting the file from SQL server itself as i took the data and printed it to a file using a perl program and it changed the \r\n to \r\r\n. I should have done binmode to the output before printing the data there itself.

Thanks again.

thesundayman

  • Comment on Re: Re: Re: Re: Can anyone figure how this works?

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Can anyone figure how this works?
by tachyon (Chancellor) on Oct 03, 2001 at 18:49 UTC

    Not sure that is actually right. Normally perl will handle line ending conversions automatically for you if you just leave binmode alone.

    Internally (in a perl program) you use \n as your symbol for a line ending and let perl handle the details - when you write a file the correct system line ending will be written and when you read a file the line endings will be converted to the internal \n. Sometimes the wheels fall off and you need to fix things manually but usually it all works beautifully.

    cheers

    tachyon

    s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print