Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: script times out mysteriously

by dws (Chancellor)
on Aug 27, 2003 at 05:24 UTC ( [id://286948]=note: print w/replies, xml ) Need Help??


in reply to script times out mysteriously

I just moved a bunch of Perl scripts over to a server that I control. First, all of my scripts now require the -w switch in order to run. .. I'd like to know how I can turn off the -w switch and have the script still run.

If you're FTPing the files from a Windows box to a *nix server in binary mode, carriage returns in the files are retained (ASCII mode removes the carriage returns). The effect of leaving carriage returns in the file is that the shebang line now reads

#!/usr/bin/perl -w^M
Depending on how you view the file, you might not see the ^M. With the -w there, this is O.K., but if you remove it and then FTP the file again, you'll get
#!/usr/bin/perl^M
which no longer names a valid executable file. You try to bring the file up through a web server, and you'll get a 500.

Try FTPing in ascii mode.

Replies are listed 'Best First'.
Re: Re: script times out mysteriously
by bobn (Chaplain) on Aug 27, 2003 at 13:58 UTC

    On a *nix box,

    vim -C file
    will show the ^M sequences.

    --Bob Niederman, http://bob-n.com

    All code given here is UNTESTED unless otherwise stated.

Re: Re: script times out mysteriously
by Anonymous Monk on Aug 27, 2003 at 16:21 UTC
    I was FTPing from Unix to Unix in ASCII mode.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (3)
As of 2024-04-24 21:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found