Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Request concerning __END__ Message-ID: <9484@jpl-devvax.JPL.NASA.GOV> Date: 12 Sep 90 21:52:48 GMT References: <1990Sep12.152018.2904@squirrel.mh.nl> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 33 In article <1990Sep12.152018.2904@squirrel.mh.nl> Johan Vromans writes: : Is it a weird idea to always treat lines following __END__ as input : for the program, even if the program itself is not read from standard : input? Better not be weird. I already implemented it. : E.g. assume "t.pl" is executable and contains : : #!/usr/bin/perl : while ( <> ) { : print "-> $_"; : } : __END__ : data1 : data2 : : Then "perl < t.pl" works, but "perl t.pl" and "t.pl" do not. After the next patch, say #!/usr/bin/perl while ( ) { print "-> $_"; } __END__ data1 data2 and it will work all the time. Note that this is upward compatible since we're reading off a filehandle that hasn't been explicitly opened. Larry