in reply to __DATA__ on commandline does not work?

Here's a way that works without -e for Unix shells:
$ perl print <DATA>; __DATA__ line 1 line 2 ^D line 1 line 2

Hit Ctrl-D at ^D.

Replies are listed 'Best First'.
Re^2: __DATA__ on commandline does not work?
by cdarke (Prior) on Apr 11, 2010 at 14:24 UTC
    Expanding that to use a here doc.:
    #!/bin/bash perl << HDEND print <DATA>; __DATA__ line 1 line 2 HDEND

      ...which s almost exactly my second codefragment in the question.


      s$$([},&%#}/&/]+}%&{})*;#$&&s&&$^X.($'^"%]=\&(|?*{%
      +.+=%;.#_}\&"^"-+%*).}%:##%}={~=~:.")&e&&s""`$''`"e