Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: On debugging "Premature End of Script" errors

by halley (Prior)
on May 06, 2003 at 17:23 UTC ( [id://255955]=note: print w/replies, xml ) Need Help??


in reply to On debugging "Premature End of Script" errors
in thread Premature End of Script Headers Reasons?

Though the questioner said 'intermittent,' I'll also add the tip to make sure your script isn't using inconsistent line endings. A DOS-style \x0D\x0A at the end of the shebang line tends to confuse some Unix and Linux kernels. Perl doesn't mind but the kernels do.

Try running (dos2unix) on the script file, or the equivalent (perl -pie 's/\x0D//g' file).

Many editors often hide this problem *unless* the line endings are mixed within the same file: they figure you know what you're doing, or you don't know what line ending differences are.

--
[ e d @ h a l l e y . c c ]

  • Comment on Re: On debugging "Premature End of Script" errors

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://255955]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 21:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found