note
JavaFan
<blockquote><em>The third solution isn't as portable, though.</em></blockquote>
<tt>cat</tt> is probably available on more platforms than <tt>perl</tt> is. Of course, Windows rules the world, and both <tt>cat</tt> and <tt>perl</tt> are ported to Windows -- and, AFAIK, neither comes standard with the OS. Unlike <tt>cat</tt>, <c>perl</c> is <b>not</b> included in the POSIX standard for shell utilities.
<p>
<blockquote><em>Why do you think redefining $/ as I did is a potential problem? </em></blockquote>
Well, you consider someone modifying the code to be a potential problem. Would if someone modifies your code, and adds a return after the first assignment to $/, but before the second? Would if someone wraps the code in an eval, and the read triggers an exception?
964216
964223