title: why do I have to pipe perl output into a new perl command
body: <p>I want to remove whitespace between back-tick (\x60) and word characters, inside of a perl script that performs many other regex substitutions. If I print the result of the earlier substitutions to the bash shell and then pipe into a new perl invocation, it works. But inside a single perl invocation, it doesn't. In the example below, the third line (a single perl command) does not work whereas the fourth line (two separate commands) does work.</p>
  
  <pre><code>printf '%b' 'Well, `\n he said it \n' 
  printf '%b' 'Well, `\n he said it \n' | perl -p -e 'use strict; use warnings; s|\n||g;' ; echo
  printf '%b' 'Well, `\n he said it \n' | perl -p -e 'use strict; use warnings; s|\n||g; s|([\x60])\s*(\w)|$1$2|g;' ; echo
  printf '%b' 'Well, `\n he said it \n' | perl -p -e 'use strict; use warnings; s|\n||g;' | perl -p -e 'use strict; use warnings; s|([\x60])\s*(\w)|$1$2|g;'; echo
  </code></pre>
  
  <p>Why does it not work inside a single perl invocation? I thought we were supposed to avoid multiple or nested pipes (subshells).</p>
  
  <p>This is perl 5, version 18 and GNU bash, version 3.2.57(1) in BSD unix.</p>