<?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 perl error in ftp.pl in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316880#M712042</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am newbie in perl and trying to learn perl. &lt;BR /&gt;&lt;BR /&gt;Just reading today's forum reagrding ftp script in perl i tried to run on my server but it is giving below error. &lt;BR /&gt;Hope procura have answer. Pl. tell me why erorr is coming.&lt;BR /&gt;Output of  perl -MNet::FTP -le'print $Net::FTP::VERSION'&lt;BR /&gt;is 2.65&lt;BR /&gt;and perl -v shows:&lt;BR /&gt;This is perl, v5.8.0 built for PA-RISC1.1-thread-multi&lt;BR /&gt;(with 1 registered patch, see perl -V for more detail)&lt;BR /&gt;Copyright 1987-2002, Larry Wall &lt;BR /&gt;Binary build 806 provided by ActiveState Corp. &lt;A href="http://www.ActiveState.com" target="_blank"&gt;http://www.ActiveState.com&lt;/A&gt;&lt;BR /&gt;Built 21:44:05 May  2 2003&lt;BR /&gt;&lt;BR /&gt;Error message:&lt;BR /&gt;Global symbol "$ftp" requires explicit package name at ftp.pl line 16.        &lt;BR /&gt;Global symbol "$destination" requires explicit package name at ftp.pl line 19.&lt;BR /&gt;Global symbol "$destination" requires explicit package name at ftp.pl line 19.&lt;BR /&gt;Execution of ftp.pl aborted due to compilation errors.                        &lt;BR /&gt;Below is the sfript:&lt;BR /&gt;#!/usr/local/bin/perl                         &lt;BR /&gt;use strict;                             &lt;BR /&gt;use warnings;                             &lt;BR /&gt;use Net::FTP;                              &lt;BR /&gt;use Net::Netrc;&lt;BR /&gt;my $server="x.x.x.x";      &lt;BR /&gt;my $file="/home/tapas/test.txt";my $ftp = Net::FTP-&amp;gt;new ($server, Timeout =&amp;gt; 9000,Debug =&amp;gt; 3) or die "$server: cannot connect: " .$ftp-&amp;gt;message;$ftp-&amp;gt;login or die "login: " .$ftp-&amp;gt;message;&lt;BR /&gt;$ftp-&amp;gt;binary or die "binary: ".$ftp-&amp;gt;message;&lt;BR /&gt;$ftp-&amp;gt;cwd ($destination) or die "cd $destination: ".$ftp-&amp;gt;message;&lt;BR /&gt;open my $fh, "&amp;lt;:utf8", $file or die "open $file: $!";&lt;BR /&gt;$ftp-&amp;gt;put ($fh, $file); # must give remote name.&lt;BR /&gt;close $fh or die "Cannot close file\n";&lt;BR /&gt;$ftp-quit;&lt;BR /&gt;&lt;BR /&gt;Rgds&lt;BR /&gt;Tapas</description>
    <pubDate>Mon, 28 Jun 2004 08:33:50 GMT</pubDate>
    <dc:creator>Tapas Jha</dc:creator>
    <dc:date>2004-06-28T08:33:50Z</dc:date>
    <item>
      <title>perl error in ftp.pl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316880#M712042</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am newbie in perl and trying to learn perl. &lt;BR /&gt;&lt;BR /&gt;Just reading today's forum reagrding ftp script in perl i tried to run on my server but it is giving below error. &lt;BR /&gt;Hope procura have answer. Pl. tell me why erorr is coming.&lt;BR /&gt;Output of  perl -MNet::FTP -le'print $Net::FTP::VERSION'&lt;BR /&gt;is 2.65&lt;BR /&gt;and perl -v shows:&lt;BR /&gt;This is perl, v5.8.0 built for PA-RISC1.1-thread-multi&lt;BR /&gt;(with 1 registered patch, see perl -V for more detail)&lt;BR /&gt;Copyright 1987-2002, Larry Wall &lt;BR /&gt;Binary build 806 provided by ActiveState Corp. &lt;A href="http://www.ActiveState.com" target="_blank"&gt;http://www.ActiveState.com&lt;/A&gt;&lt;BR /&gt;Built 21:44:05 May  2 2003&lt;BR /&gt;&lt;BR /&gt;Error message:&lt;BR /&gt;Global symbol "$ftp" requires explicit package name at ftp.pl line 16.        &lt;BR /&gt;Global symbol "$destination" requires explicit package name at ftp.pl line 19.&lt;BR /&gt;Global symbol "$destination" requires explicit package name at ftp.pl line 19.&lt;BR /&gt;Execution of ftp.pl aborted due to compilation errors.                        &lt;BR /&gt;Below is the sfript:&lt;BR /&gt;#!/usr/local/bin/perl                         &lt;BR /&gt;use strict;                             &lt;BR /&gt;use warnings;                             &lt;BR /&gt;use Net::FTP;                              &lt;BR /&gt;use Net::Netrc;&lt;BR /&gt;my $server="x.x.x.x";      &lt;BR /&gt;my $file="/home/tapas/test.txt";my $ftp = Net::FTP-&amp;gt;new ($server, Timeout =&amp;gt; 9000,Debug =&amp;gt; 3) or die "$server: cannot connect: " .$ftp-&amp;gt;message;$ftp-&amp;gt;login or die "login: " .$ftp-&amp;gt;message;&lt;BR /&gt;$ftp-&amp;gt;binary or die "binary: ".$ftp-&amp;gt;message;&lt;BR /&gt;$ftp-&amp;gt;cwd ($destination) or die "cd $destination: ".$ftp-&amp;gt;message;&lt;BR /&gt;open my $fh, "&amp;lt;:utf8", $file or die "open $file: $!";&lt;BR /&gt;$ftp-&amp;gt;put ($fh, $file); # must give remote name.&lt;BR /&gt;close $fh or die "Cannot close file\n";&lt;BR /&gt;$ftp-quit;&lt;BR /&gt;&lt;BR /&gt;Rgds&lt;BR /&gt;Tapas</description>
      <pubDate>Mon, 28 Jun 2004 08:33:50 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316880#M712042</guid>
      <dc:creator>Tapas Jha</dc:creator>
      <dc:date>2004-06-28T08:33:50Z</dc:date>
    </item>
    <item>
      <title>Re: perl error in ftp.pl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316881#M712043</link>
      <description>Specifically removing the "use strict" will get rid of the problem but better people than I will tell you why it should remain there.</description>
      <pubDate>Mon, 28 Jun 2004 08:45:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316881#M712043</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-06-28T08:45:11Z</dc:date>
    </item>
    <item>
      <title>Re: perl error in ftp.pl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316882#M712044</link>
      <description>I've split on ';'&lt;BR /&gt;&lt;BR /&gt;1. You've not set $destination anywhere&lt;BR /&gt;2. The $ftp assignment was erroneously using the $ftp in the error message. If the connectr fails, you don't have an $ftp set, and hence cannot use it's methods.&lt;BR /&gt;&lt;BR /&gt;#!/usr/local/bin/perl &lt;BR /&gt;use strict; &lt;BR /&gt;use warnings; &lt;BR /&gt;use Net::FTP; &lt;BR /&gt;use Net::Netrc;&lt;BR /&gt;my $server="x.x.x.x"; &lt;BR /&gt;my $file="/home/tapas/test.txt";&lt;BR /&gt;my $destination = "/pub/foo/bar/baz";&lt;BR /&gt;my $ftp = Net::FTP-&amp;gt;new ($server, Timeout =&amp;gt; 9000,Debug =&amp;gt; 3);&lt;BR /&gt;$ftp die "$server: cannot connect: $@";&lt;BR /&gt;$ftp-&amp;gt;login or die "login: " .$ftp-&amp;gt;message;&lt;BR /&gt;$ftp-&amp;gt;binary or die "binary: ".$ftp-&amp;gt;message;&lt;BR /&gt;$ftp-&amp;gt;cwd ($destination) or die "cd $destination: ".$ftp-&amp;gt;message;&lt;BR /&gt;open my $fh, "&amp;lt;:utf8", $file or die "open $file: $!";&lt;BR /&gt;$ftp-&amp;gt;put ($fh, $file); # must give remote name.&lt;BR /&gt;close $fh or die "Cannot close file\n";&lt;BR /&gt;$ftp-quit;&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Mon, 28 Jun 2004 08:46:18 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316882#M712044</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-06-28T08:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: perl error in ftp.pl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316883#M712045</link>
      <description>Mark, getting rid of 'use strict' is never ever going to solve the problem. It just hides the errors and will die on run-time.&lt;BR /&gt;&lt;BR /&gt;_I_ am the one going to say: Never ever write scripts that should last without use strict and use warnings, and never remove these to get rid of (annoying) messages. It is far more likely that you made an error^Wtypo.&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Mon, 28 Jun 2004 08:48:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316883#M712045</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-06-28T08:48:43Z</dc:date>
    </item>
    <item>
      <title>Re: perl error in ftp.pl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316884#M712046</link>
      <description>If you have an error of connection in this line : &lt;BR /&gt;my $ftp = Net::FTP-&amp;gt;new ($server, Timeout =&amp;gt; 9000,Debug =&amp;gt; 3) or die "$server: cannot connect: " .$ftp-&amp;gt;message;&lt;BR /&gt;You are trying to die with a message including $ftp-&amp;gt;message, where $ftp is undefined...&lt;BR /&gt;&lt;BR /&gt;This is the first thing I see, but it can be something else.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;&lt;BR /&gt;Fred&lt;BR /&gt;</description>
      <pubDate>Mon, 28 Jun 2004 08:52:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316884#M712046</guid>
      <dc:creator>Fred Ruffet</dc:creator>
      <dc:date>2004-06-28T08:52:23Z</dc:date>
    </item>
    <item>
      <title>Re: perl error in ftp.pl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316885#M712047</link>
      <description>procura,&lt;BR /&gt; &lt;BR /&gt;Indeed you were the person I was referring to  and hoped that it would be you explaining the error of my ways :)&lt;BR /&gt; &lt;BR /&gt;See you later should beepz ever return!</description>
      <pubDate>Mon, 28 Jun 2004 08:53:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316885#M712047</guid>
      <dc:creator>Mark Grant</dc:creator>
      <dc:date>2004-06-28T08:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: perl error in ftp.pl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316886#M712048</link>
      <description>Hi Procura,&lt;BR /&gt;&lt;BR /&gt;I am getting below error message  while compiling.  Line 17 is $ftp die "$server: cannot connect:$@";&lt;BR /&gt;&lt;BR /&gt;syntax error at ftp.pl line 17, near "$ftp die"       &lt;BR /&gt;Execution of ftp.pl aborted due to compilation errors.&lt;BR /&gt;&lt;BR /&gt;Rgds&lt;BR /&gt;Tapas</description>
      <pubDate>Tue, 29 Jun 2004 00:47:58 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316886#M712048</guid>
      <dc:creator>Tapas Jha</dc:creator>
      <dc:date>2004-06-29T00:47:58Z</dc:date>
    </item>
    <item>
      <title>Re: perl error in ftp.pl</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316887#M712049</link>
      <description>Stupid cut-n-paste ...&lt;BR /&gt;&lt;BR /&gt;$ftp or die "FTP: cannot connect";&lt;BR /&gt;&lt;BR /&gt;or something like that. The or was dropped somehow.&lt;BR /&gt;&lt;BR /&gt;Enjoy, Have FUN! H.Merijn</description>
      <pubDate>Tue, 29 Jun 2004 01:14:57 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/perl-error-in-ftp-pl/m-p/3316887#M712049</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2004-06-29T01:14:57Z</dc:date>
    </item>
  </channel>
</rss>

