in reply to Re^2: __END__ without __BEGIN__?
in thread __END__ without __BEGIN__?

There is such a construct if you use the -x switch:
>perl -x <<END bla bla bla ignored #!perl stuff_to_execute(); __END__ bla bla END
updated: s/<END/<<END/

Replies are listed 'Best First'.
Re^4: __END__ without __BEGIN__?
by CountZero (Bishop) on Mar 29, 2005 at 21:30 UTC
    b@d #! perl; print 'ignore b@d'; die;
    Will do what you want if started as perl -x your_script.pl

    CountZero

    "If you have four groups working on a compiler, you'll get a 4-pass compiler." - Conway's Law

Re^4: __END__ without __BEGIN__?
by ktross (Deacon) on Mar 29, 2005 at 21:21 UTC
    Hmmm, still requires the addition of code "<<END" before the data.

    Update: Yeah, I know I was wrong. Joost's solution works.

      The heredoc joost used is quoting for his shell, not perl. Put the following in a file (443263.pl, in my case) then run it using the -x command line switch.
      bla bla bla ignored #!perl #stuff_to_execute(); print "Hello, world!\n"; __END__ bla bla
      Output without -x: C:\S>perl 443263.pl syntax error at 443263.pl line 6, near "ignored" Execution of 443263.pl aborted due to compilation errors. With -x: C:\S>perl -x 443263.pl Hello, world!
      see perlrun for details