in reply to Re: chop vs chomp
in thread chop vs chomp

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re^3: chop vs chomp
by chromatic (Archbishop) on May 11, 2007 at 07:37 UTC
    I explained before that point already in the OM that the proper approach is something else e.g. to put a trailer on the end.

    You have three possibilities then.

    • Use your time machine to go back some thirty-five years to the start of Unix and force all text files to end with a trailing newline.
    • Fix all of the files in the past thirty-five plus years of Unix to include the trailing newline, plus all of the utilities that manipulate those files, to match your idea of reality.
    • Admit that your idea doesn't match reality.

    Maybe all progress depends on the unreasonable man, but you can't turn it around to say that all unreasonable ideas imply progress.

    Now if you do have a time machine, I apologize profusely in the hope that you'll let me borrow it briefly. I have a really good business plan that depends on having a working time machine.

    (I'm also still waiting for you to fix the bugs in Chump or Chimp or Chorq or whatever your "replacement" is.)

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re^3: chop vs chomp
by shmem (Chancellor) on May 11, 2007 at 07:54 UTC
    Anyone who tried to rely on carriege return (line completion) as an indication of file completion for commercial data provision would simply lose the business

    Could you please point out where in the perl documentation is it stated that chop or chomp have anything to do with file completeness validation?

    There is no instead of - chomp's functionality is professionally unacceptable from the start.

    Sure - if you use it for the wrong purpose, and if you expect it to do things it doesn't. If a file has been checked for completeness and its lines were found suitable for chomp, then chomp is the right tool to use. It is not the other way round.

    I'm looking forward to your rant on autovivification as another "professionally unacceptable functionality" in perl...

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
    A reply falls below the community's threshold of quality. You may see it by logging in.