warning flag on shebang line - premature end of script header

Discussion in 'Perl Misc' started by Prachi, May 17, 2005.

  1. Prachi

    Prachi Guest

    I have this perl cgi script which works great when I have the -w
    warning flag on the shebang line. But, if remove the -w flag, it
    generates a 'Premature end of script header' error. Could someone
    explain why this could happen?

    Thanks!
    Prachi.
    Prachi, May 17, 2005
    #1
    1. Advertising

  2. Prachi

    Guest

    Prachi <> wrote:
    > I have this perl cgi script which works great when I have the -w
    > warning flag on the shebang line. But, if remove the -w flag, it
    > generates a 'Premature end of script header' error. Could someone
    > explain why this could happen?


    Not without seeing the script, no.

    Axel
    , May 17, 2005
    #2
    1. Advertising

  3. Prachi

    phaylon Guest

    Prachi wrote:

    > I have this perl cgi script which works great when I have the -w warning
    > flag on the shebang line. But, if remove the -w flag, it generates a
    > 'Premature end of script header' error. Could someone explain why this
    > could happen?


    I think we've got that one before in here. Check your line-endings, maybe
    your system get's a #!/path/to/perl^X as shebang, which would lead to
    #!/path/to/perl -w^X if you specify -w. The ^X is for that one char which
    shouldn't be there.

    hth,p

    --
    http://www.dunkelheit.at/
    thou shallst fear...
    phaylon, May 17, 2005
    #3
  4. wrote in news:9Jnie.87450$Cq2.20249
    @fe2.news.blueyonder.co.uk:

    > Prachi <> wrote:
    >> I have this perl cgi script which works great when I have the -w
    >> warning flag on the shebang line. But, if remove the -w flag, it
    >> generates a 'Premature end of script header' error. Could someone
    >> explain why this could happen?

    >
    > Not without seeing the script, no.


    As well as the exact error.

    Guess: OP, did you remember to transfer the file in ASCII mode over FTP?

    Please do read the guidelines for this group to learn how you can help
    others help you.

    Sinan

    --
    A. Sinan Unur <>
    (reverse each component and remove .invalid for email address)

    comp.lang.perl.misc guidelines on the WWW:
    http://mail.augustmail.com/~tadmc/clpmisc/clpmisc_guidelines.html
    A. Sinan Unur, May 17, 2005
    #4
  5. Prachi

    Prachi Guest

    Sorry about my question with no details. But, my script was rather
    large and it uses a few of my modules as well, so I decided to see if
    it was a well known thing and could be answered without the code etc.
    ftping the files again in ascii mode solved my problem.
    Thanks everyone for all the help!

    Prachi
    Prachi, May 17, 2005
    #5
  6. Prachi wrote:
    > I have this perl cgi script which works great when I have the -w
    > warning flag on the shebang line. But, if remove the -w flag, it
    > generates a 'Premature end of script header' error. Could someone
    > explain why this could happen?


    Have a look at: perldoc -q 500

    sherm--

    --
    Cocoa programming in Perl: http://camelbones.sourceforge.net
    Hire me! My resume: http://www.dot-app.org
    Sherm Pendley, May 17, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wayne Deleersnyder

    Premature end of script headers

    Wayne Deleersnyder, Nov 21, 2003, in forum: Perl
    Replies:
    1
    Views:
    652
    Wayne Deleersnyder
    Nov 21, 2003
  2. Andres Corrada-Emmanuel

    Optimize flag on shebang line

    Andres Corrada-Emmanuel, Dec 9, 2003, in forum: Python
    Replies:
    0
    Views:
    321
    Andres Corrada-Emmanuel
    Dec 9, 2003
  3. Greeshma
    Replies:
    0
    Views:
    344
    Greeshma
    Feb 25, 2004
  4. Greeshma
    Replies:
    1
    Views:
    482
  5. Phil Frost

    Re: premature end of script headers

    Phil Frost, Jul 10, 2004, in forum: Python
    Replies:
    0
    Views:
    538
    Phil Frost
    Jul 10, 2004
Loading...

Share This Page