Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

Re: script times out mysteriously

by dws (Chancellor)
on Aug 27, 2003 at 05:24 UTC ( #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
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,

    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?

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2020-02-22 04:19 GMT
Find Nodes?
    Voting Booth?
    What numbers are you going to focus on primarily in 2020?

    Results (98 votes). Check out past polls.