in reply to codeperl -pe 's/\n/" " . /e' data/code

First, Randal may not have written that line, the primary author on that book is Joeseph Hall.

perl -pe 's/\n/" " . <>/e' data

This is a command line, obviously, and if you read perlrun, you will read that -p will make the assumption that there is a while() loop around your code. So, this would look similar to the following, to Perl:

while (&lt;&gt;) { s/\n/" " . <>/e; }

As stated in other responses the /e allows you to be able to evaluate things on the right side of an s///.
2: if data is a filehande and this is a one-liner, how does data get input from a file with "\n"=separated values? It isn't a filehandle, it is a file name. It get's the the data with \n seperated values because that is what the lines of the file are seperated with. This is not different that opening a file and itterating over it from within a script.

Cheers,
KM

Replies are listed 'Best First'.
RE: Re: codeperl -pe 's/\n/
by merlyn (Sage) on May 27, 2000 at 00:13 UTC
    I actually don't recall now whether I wrote it or Joseph did.:)
      Joseph said you suggested the shiny ball, and that's all you did ;) Just kidding. He never mentioned to me who did what, just gave me some pointers on authoring that came up from when he was working on it.

      Cheers,
      KM