Oh, why stop at perlport?  Here's a sweep of the doc for chop abuses
(note, this assumes the preceeding perlport and perlfunc patches have
been applied):

Some bits I wasn't sure about...
- perlfaq8 contains a use of chop() to clip newlines from a modem.  I
  presume its ok to chomp() instead?  Must be, because <MODEM> is used.


--- pod/perldiag.pod    2001/02/03 10:07:29     1.1
+++ pod/perldiag.pod    2001/02/03 10:07:42
@@ -3549,8 +3549,7 @@
 
 (W newline) A file operation was attempted on a filename, and that
 operation failed, PROBABLY because the filename contained a newline,
-PROBABLY because you forgot to chop() or chomp() it off.  See
-L<perlfunc/chomp>.
+PROBABLY because you forgot to chomp() it off.  See L<perlfunc/chomp>.
 
 =item Unsupported directory function "%s" called
 
--- pod/perlfaq8.pod    2001/02/03 10:10:21     1.1
+++ pod/perlfaq8.pod    2001/02/03 10:10:25
@@ -321,7 +321,7 @@
        # been opened on a pipe...
        system("/bin/stty $stty");
        $_ = <MODEM_IN>;
-       chop;
+       chomp;
        if ( !m/^Connected/ ) {
            print STDERR "$0: cu printed `$_' instead of `Connected'\n";
        }
--- pod/perlutil.pod    2001/02/03 10:12:37     1.1
+++ pod/perlutil.pod    2001/02/03 10:12:45
@@ -97,7 +97,7 @@
 on C<s/foo/bar> will produce a Perl program based around this:
 
     while (<>) {
-        chop;
+        chomp;
         s/foo/bar/g;
         print if $printit;
     }



-- 

Michael G. Schwern   <[EMAIL PROTECTED]>    http://www.pobox.com/~schwern/
<purl> Hey, Schwern!  THERE IS A HUGE GAZORGANSPLATTEDFARTMONGERING-
LIGHTENINGBEASTASAURSOPOD BEHIND YOU!  RUN, BEFORE IT GAFLUMMOXES YOUR
INNARDLYBITS!

Reply via email to