<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Perl and  FTP in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-and-ftp/m-p/4269720#M688480</link>
    <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Is there any way to encrypt a perl script so if someone wants to open it for read will ask some password however the script is executable anyway?&lt;BR /&gt;&lt;BR /&gt;By using the Net::Netrc module you don't have a plaintext password in the Perl script itself, so there is no danger in seeing the script's contents.&lt;BR /&gt;&lt;BR /&gt;In lieu of FTP, you could easily change to SFTP using Perl's Net::SFTP::Foreign module.  Fetch it and read its documentation here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://search.cpan.org/~salva/Net-SFTP-Foreign-1.43/lib/Net/SFTP/Foreign.pm" target="_blank"&gt;http://search.cpan.org/~salva/Net-SFTP-Foreign-1.43/lib/Net/SFTP/Foreign.pm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
    <pubDate>Tue, 30 Sep 2008 10:45:27 GMT</pubDate>
    <dc:creator>James R. Ferguson</dc:creator>
    <dc:date>2008-09-30T10:45:27Z</dc:date>
    <item>
      <title>Perl and  FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-and-ftp/m-p/4269716#M688476</link>
      <description>I am writing a perl script and using Net:FTP module. &lt;BR /&gt;&lt;BR /&gt;I was wondering if there is away I can have the script detect the file type ( Binary or ASCII) automatically?&lt;BR /&gt;&lt;BR /&gt;I am putting the FTP server login in credentials in the script. Is there any way to hide/encrypt the password field?&lt;BR /&gt;&lt;BR /&gt;Is there any way to encrypt a perl script so if someone wants to open it for read will ask some password however the script is executable anyway?&lt;BR /&gt;&lt;BR /&gt;Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 15 Sep 2008 18:12:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-and-ftp/m-p/4269716#M688476</guid>
      <dc:creator>rccmum</dc:creator>
      <dc:date>2008-09-15T18:12:12Z</dc:date>
    </item>
    <item>
      <title>Re: Perl and  FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-and-ftp/m-p/4269717#M688477</link>
      <description>&lt;!--!*#--&gt;Yes, using ~/.netrc and Net::Netrc&lt;BR /&gt;&lt;BR /&gt;--8&amp;lt;---&lt;BR /&gt;use Net::FTP;&lt;BR /&gt;use Net::Netrc;&lt;BR /&gt;&lt;BR /&gt;my ($host, $u, $p) = ("some.host.com", "username");&lt;BR /&gt;if (my $machine = Net::Netrc-&amp;gt;lookup ($host)) {&lt;BR /&gt;    ($u, $p) = $machine-&amp;gt;lpa;&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;my $ftp = Net::FTP-&amp;gt;new ($host, Passive =&amp;gt; 1) or die "Connect failed: $@";&lt;BR /&gt;$ftp-&amp;gt;login ($u, $p) or die "login: "    .$ftp-&amp;gt;message;&lt;BR /&gt;$ftp-&amp;gt;binary  or die "binary: "   .$ftp-&amp;gt;messgae;&lt;BR /&gt;--&amp;gt;8---&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Mon, 15 Sep 2008 19:41:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-and-ftp/m-p/4269717#M688477</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2008-09-15T19:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: Perl and  FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-and-ftp/m-p/4269718#M688478</link>
      <description>&amp;gt; I was wondering if there is away I can have the script detect the file type ( Binary or ASCII) automatically?&lt;BR /&gt; &lt;BR /&gt;There isn't any method to detect ASCII except to guess. The problem is that BINARY is an ftp protocol that simply sends exactly what is on the source and stores it the same way on the destination. An ASCII transfer is much more complicated to accommodate the myriad of differences between OS file formats. In the code, the source file is read one record at a time with the record defined by the source system. This record is sent with length information so that that receiving side can add whatever special code(s) are needed to form an "ASCII" file on the destination system. Mainframes have dozens of specialized formats so ASCII can be quite useful in transferring text files.&lt;BR /&gt; &lt;BR /&gt;But the definition of an ASCII file, especially in Unix is quite convoluted. A Postscript file is ASCII but technically, a PCL file is mostly ASCII with escape sequences. An awk or Perl script is ASCII but a library file or executable is binary but of dubious value on another system. So the decision must be made based on the purpose and usage of the file.&lt;BR /&gt; &lt;BR /&gt;&amp;gt; credentials in the script&lt;BR /&gt; &lt;BR /&gt;Why worry about it? Anyone can sniff the network and see the plain text login and password. That's why ftp is deprecated for secure data transmissions or at least limited to FTP-only chroot accounts.&lt;BR /&gt; &lt;BR /&gt;If you have no choice in FTP, consider using $HOME/.netrc to hide the login/password outside the script. This is only a trivial mechanism because the script must be run by the user with the $HOME/.netrc file.&lt;BR /&gt; &lt;BR /&gt;The ideal method is scp or sftp using public key exchange. In this way, no user or password is visible during the negotiation and the data is protected.</description>
      <pubDate>Tue, 16 Sep 2008 01:32:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-and-ftp/m-p/4269718#M688478</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2008-09-16T01:32:49Z</dc:date>
    </item>
    <item>
      <title>Re: Perl and  FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-and-ftp/m-p/4269719#M688479</link>
      <description>Thank you both of you for your responses and time.&lt;BR /&gt;&lt;BR /&gt;Any comment on the encrypting a perl script?&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks again for your help.</description>
      <pubDate>Tue, 30 Sep 2008 01:57:46 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-and-ftp/m-p/4269719#M688479</guid>
      <dc:creator>rccmum</dc:creator>
      <dc:date>2008-09-30T01:57:46Z</dc:date>
    </item>
    <item>
      <title>Re: Perl and  FTP</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-and-ftp/m-p/4269720#M688480</link>
      <description>Hi:&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Is there any way to encrypt a perl script so if someone wants to open it for read will ask some password however the script is executable anyway?&lt;BR /&gt;&lt;BR /&gt;By using the Net::Netrc module you don't have a plaintext password in the Perl script itself, so there is no danger in seeing the script's contents.&lt;BR /&gt;&lt;BR /&gt;In lieu of FTP, you could easily change to SFTP using Perl's Net::SFTP::Foreign module.  Fetch it and read its documentation here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://search.cpan.org/~salva/Net-SFTP-Foreign-1.43/lib/Net/SFTP/Foreign.pm" target="_blank"&gt;http://search.cpan.org/~salva/Net-SFTP-Foreign-1.43/lib/Net/SFTP/Foreign.pm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Regards!&lt;BR /&gt;&lt;BR /&gt;...JRF...</description>
      <pubDate>Tue, 30 Sep 2008 10:45:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-and-ftp/m-p/4269720#M688480</guid>
      <dc:creator>James R. Ferguson</dc:creator>
      <dc:date>2008-09-30T10:45:27Z</dc:date>
    </item>
  </channel>
</rss>

