in reply to Re: read and write to same file
in thread read and write to same file

Unless I'm missing something, chop will take of the end of line character first, based on $/. So you'd have to chomp (to safely remove the possibly non-existent end of line character) then chop. Then put the end of line character back on, assuming there was one to begin with. Or chop once, check to see if it was an eol character, and chop again for the comma and tack the eol character back on.

So. Am I missing something obvious here?

Replies are listed 'Best First'.
Re^3: read and write to same file
by strat (Canon) on Aug 20, 2005 at 08:08 UTC

    this posting was absolutely well-formed and correct, but nobody posted a question matching to my answer, so I removed it... it was too early in the morning...

    Please, dear NodeReaper, would you mind removing my posting

    Best regards,
    perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"