Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

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 making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2020-09-26 08:11 GMT
Find Nodes?
    Voting Booth?
    If at first I donít succeed, I Ö

    Results (141 votes). Check out past polls.