Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine

Re: On debugging "Premature End of Script" errors

by halley (Prior)
on May 06, 2003 at 17:23 UTC ( #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?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2016-10-21 19:30 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (289 votes). Check out past polls.