FTPing a script.
From the doc:
The protocol also defines several standard translations which the file can undergo during transfer. These are ASCII, EBCDIC, binary, and byte. ASCII is the default type, and indicates that the sender of files will translate the ends of lines to a standard representation which the receiver will then translate back into their local representation.

When I ftp a script and run it I get 'page cannot be displayed'.
If I use my ftp prog it is ok. Is this a translation problem? I expected the 'ASCII is the default' to look after that.
If I need to set '$ftp->ascii' what 'ARGS' are needed.

#!/usr/bin/perl use strict; use warnings; use Net::FTP; my $host = 'xxxxx'; my $uid = 'xxxxx'; my $pwd = 'xxxxx'; my $local_file = 'c:/perl/myperl/dev/test_mod.cgi'; my $remote_path = 'docroot/z_cwi_cgi/z_test'; my $remote_file = 'test_mod.cgi'; my $ftp = Net::FTP->new( $host ) or die "can't connect"; $ftp->login( $uid, $pwd ) or die "can't login"; $ftp->cwd( $remote_path ) or die "can't cwd"; $ftp->ascii() or die "can't ascii"; $ftp->put( $local_file, $remote_file ) or die "can't put"; $ftp->quit or die "can't quit";
I use Net::FTP for posting html files and have found it excellent.
winXP and activestate 5.8
Updated: Added $ftp->ascii() after $ftp->cwd()
Update 2: This node has the answer 240895. Apologies for not looking harder.
Update 3: The workround in 240895 works! All praise to Thelonius!

In reply to Net::FTP ascii translation by wfsp

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.