[31146] in Perl-Users-Digest
Perl-Users Digest, Issue: 2391 Volume: 11
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon May 4 21:19:41 2009
Date: Mon, 4 May 2009 18:09:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Perl-Users Digest Mon, 4 May 2009 Volume: 11 Number: 2391
Today's topics:
Re: Help with Net::ftp not downloading <edMbj@aes-intl.com>
Re: Help with Net::ftp not downloading <edMbj@aes-intl.com>
Re: Help with Net::ftp not downloading <nat.k@gm.ml>
Re: Help with Net::ftp not downloading <edMbj@aes-intl.com>
Re: Help with Net::ftp not downloading <nat.k@gm.ml>
Re: Help with Net::ftp not downloading <edMbj@aes-intl.com>
Re: Perl is too slow - A statement (aka ? the Platypus)
Re: Perl is too slow - A statement <nat.k@gm.ml>
Re: Perl OLE Excel 2003 Problem with freezepane, <1usa@llenroc.ude.invalid>
Re: Test post, no longer available? <1usa@llenroc.ude.invalid>
Re: Test post, no longer available? <nat.k@gm.ml>
Re: Test post, no longer available? <tadmc@seesig.invalid>
Re: Test post, no longer available? <nat.k@gm.ml>
Re: Unbelievable, Easy News trashes arbitrary message b <tadmc@seesig.invalid>
Re: Unbelievable, Easy News trashes arbitrary message b <nat.k@gm.ml>
Re: Unbelievable, Easy News trashes arbitrary message b <nat.k@gm.ml>
Re: Unbelievable, Easy News trashes arbitrary message b <news@lawshouse.org>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Mon, 04 May 2009 15:14:24 -0700
From: Ed Jay <edMbj@aes-intl.com>
Subject: Re: Help with Net::ftp not downloading
Message-Id: <ospuv4tcedf1ae7tn3mea99u8puuqkl3v5@4ax.com>
J. Gleixner wrote:
>Ed Jay wrote:
>> I'm still a novice at Perl. I'm trying to develop a simple script to
>> download a set of files from my server to my local drive. Although I'm not
>> getting any error messages, the script isn't performing. Help, please!
>>
>> (BTW, using this script I have been able to change and delete file names
>> on the server, so I know I'm properly logged in.)
>>
>> My script:
>>
>> use CGI ':standard';
>> use CGI::Carp qw(fatalsToBrowser);
>You know what that does, right?
AFAIK, it prints the error messages to the screen.
>
>> my $query = new CGI;
>When you use :standard, you don't need to do that.
Thanks.
>
>> use Net::FTP;
>
>use strict;
>
>>
>> my $home = 'myDomain';
>> my $directory="public_html/uploads";
>> my $fileTest = "Test.IRI";
>
>You may use single quotes there, to be consistent.
>
>> my $localDir = 'F:/_Downloads';
>>
>> print "Content-type: text/html\n\n";
>
>You're not 'print'ing any HTML.
Actually, I am, only I didn't include it, as it's not relevant to my
question.
>
>>
>> $ftp=Net::FTP->new($host,Timeout=>240,Debug =>1,Passive=>1) or $error=1;
>Why are you not using
>
>my $ftp = ..
>
>there?
>
I almost never use 'my.'
>
>> push @ERRORS, "Can't ftp to $host: $!\n" if $error;
>
>According to the documentation, $@ is what you want to use, not $!.
>$ftp = Net::FTP->new("some.host.name", Debug => 0)
> or die "Cannot connect to some.host.name: $@";
>
Thanks.
>
>> if ($error) {push @ERRORS, "Can't connect to $host: $!\n";myerrors();}
>> print "Connected<br>\n";
>>
>> $ftp->login("myusername","mypassword") or $error=1;
>> if ($error) {push @ERRORS, "Can't login to $host: $!\n";myerrors();}
>
>Again, according to documentation, use the 'message' method:
>$ftp->login("anonymous",'-anonymous@')
> or die "Cannot login ", $ftp->message;
>>
>> $ftp->cwd($directory) or $error=1;
>> if ($error) {push @ERRORS, "Can't cd $!\n";myerrors();}
>> print "Successfully logged in to folder<br><br>\n";
>Use 'message' method there, and in the rest of the program.
>
Thanks, again. Everything has been changed to:
$ftp->(do something) or die "Cannot xxx", $ftp->message;
>>
>> chdir($localDir);
>
>What if that fails?
>
Hammer meet nail! I added the error message trap, an lo, I get an error
message saying it can't change the local directory. Doesn't tell me why,
only what the path is on the server.
>>
>> $ftp->binary();
>>
>> $ftp->pasv ();
>>
>> $ftp->get($fileTest) or $error=1;
>> if ($error) {push @ERRORS, "Can't get file $!\n";myerrors();}
>> print "Successfully downloaded $fileTest<br><br>\n";
>>
>> @files=$ftp->ls() or $error=1;
>> if ($error) {push @ERRORS, "Can't get file list $!\n";myerrorsors();}
>>
>> foreach(@files) {print "$_<br>\n";}
>>
>> print "<br>\n";
>> $ftp->quit;
>
>> exit 0;
>That exit isn't needed.
>
I added this as a 'safety device.'
>>
>> sub myerrorsors {$ftp->quit;print "Error: \n";print @ERRORS;exit 0;}
>>
>> Thanks in advance for your direction,
>>
>
>Hopefully, after using the correct methods to display errors, and/or
>using the Debug parameter, it'll help. Also, first get it working
>without running as a CGI.
I removed the CGI reference, but get the same error.
--
Ed Jay (remove 'M' to reply by email)
Win the War Against Breast Cancer.
Knowing the facts could save your life.
http://www.breastthermography.info
------------------------------
Date: Mon, 04 May 2009 15:15:48 -0700
From: Ed Jay <edMbj@aes-intl.com>
Subject: Re: Help with Net::ftp not downloading
Message-Id: <b6quv4tkq1j7q64gu7rcan5s9biqgvpt86@4ax.com>
Peter Makholm wrote:
>Ed Jay <edMbj@aes-intl.com> writes:
>
>> I'm still a novice at Perl. I'm trying to develop a simple script to
>> download a set of files from my server to my local drive. Although I'm not
>> getting any error messages, the script isn't performing. Help, please!
>>
>> (BTW, using this script I have been able to change and delete file names
>> on the server, so I know I'm properly logged in.)
>
>Step 1 is to investigate if you got a Perl problem or a non-Perl
>problem. Can you download files with another ftp client using the same
>active/passive setting?
>
Thanks. Yes, using another client I can download with a passive setting.
In fact, when I was initially unable to download, I added the Passive
directive in case it needed it.
--
Ed Jay (remove 'M' to reply by email)
Win the War Against Breast Cancer.
Knowing the facts could save your life.
http://www.breastthermography.info
------------------------------
Date: Mon, 04 May 2009 16:14:46 -0700
From: Nathan Keel <nat.k@gm.ml>
Subject: Re: Help with Net::ftp not downloading
Message-Id: <GFKLl.29329$vj3.13434@newsfe01.iad>
Ed Jay wrote:
> J. Gleixner wrote:
>
>>Ed Jay wrote:
>>> I'm still a novice at Perl. I'm trying to develop a simple script to
>>> download a set of files from my server to my local drive. Although
>>> I'm not getting any error messages, the script isn't performing.
>>> Help, please!
>>>
>>> (BTW, using this script I have been able to change and delete file
>>> names on the server, so I know I'm properly logged in.)
>>>
>>> My script:
>>>
>>> use CGI ':standard';
>>> use CGI::Carp qw(fatalsToBrowser);
>>You know what that does, right?
>
> AFAIK, it prints the error messages to the screen.
>>
>>> my $query = new CGI;
>>When you use :standard, you don't need to do that.
>
> Thanks.
>>
>>> use Net::FTP;
>>
>>use strict;
>>
>>>
>>> my $home = 'myDomain';
>>> my $directory="public_html/uploads";
>>> my $fileTest = "Test.IRI";
>>
>>You may use single quotes there, to be consistent.
>>
>>> my $localDir = 'F:/_Downloads';
>>>
>>> print "Content-type: text/html\n\n";
>>
>>You're not 'print'ing any HTML.
>
> Actually, I am, only I didn't include it, as it's not relevant to my
> question.
>>
>>>
>>> $ftp=Net::FTP->new($host,Timeout=>240,Debug =>1,Passive=>1) or
>>> $error=1;
>>Why are you not using
>>
>>my $ftp = ..
>>
>>there?
>>
> I almost never use 'my.'
>>
>>> push @ERRORS, "Can't ftp to $host: $!\n" if $error;
>>
>>According to the documentation, $@ is what you want to use, not $!.
>>$ftp = Net::FTP->new("some.host.name", Debug => 0)
>> or die "Cannot connect to some.host.name: $@";
>>
> Thanks.
>>
>>> if ($error) {push @ERRORS, "Can't connect to $host:
>>> $!\n";myerrors();}
>>> print "Connected<br>\n";
>>>
>>> $ftp->login("myusername","mypassword") or $error=1;
>>> if ($error) {push @ERRORS, "Can't login to $host: $!\n";myerrors();}
>>
>>Again, according to documentation, use the 'message' method:
>>$ftp->login("anonymous",'-anonymous@')
>> or die "Cannot login ", $ftp->message;
>>>
>>> $ftp->cwd($directory) or $error=1;
>>> if ($error) {push @ERRORS, "Can't cd $!\n";myerrors();}
>>> print "Successfully logged in to folder<br><br>\n";
>>Use 'message' method there, and in the rest of the program.
>>
> Thanks, again. Everything has been changed to:
> $ftp->(do something) or die "Cannot xxx", $ftp->message;
>>>
>>> chdir($localDir);
>>
>>What if that fails?
>>
> Hammer meet nail! I added the error message trap, an lo, I get an
> error message saying it can't change the local directory. Doesn't tell
> me why, only what the path is on the server.
>>>
>>> $ftp->binary();
>>>
>>> $ftp->pasv ();
>>>
>>> $ftp->get($fileTest) or $error=1;
>>> if ($error) {push @ERRORS, "Can't get file $!\n";myerrors();}
>>> print "Successfully downloaded $fileTest<br><br>\n";
>>>
>>> @files=$ftp->ls() or $error=1;
>>> if ($error) {push @ERRORS, "Can't get file list
>>> $!\n";myerrorsors();}
>>>
>>> foreach(@files) {print "$_<br>\n";}
>>>
>>> print "<br>\n";
>>> $ftp->quit;
>>
>>> exit 0;
>>That exit isn't needed.
>>
> I added this as a 'safety device.'
>>>
>>> sub myerrorsors {$ftp->quit;print "Error: \n";print @ERRORS;exit 0;}
>>>
>>> Thanks in advance for your direction,
>>>
>>
>>Hopefully, after using the correct methods to display errors, and/or
>>using the Debug parameter, it'll help. Also, first get it working
>>without running as a CGI.
>
> I removed the CGI reference, but get the same error.
>
It's not just removing the reference. How are you running it? Did you
add the other error checking and see anything new reported?
------------------------------
Date: Mon, 04 May 2009 17:28:43 -0700
From: Ed Jay <edMbj@aes-intl.com>
Subject: Re: Help with Net::ftp not downloading
Message-Id: <oo1vv49pgedmrfspabc3c5252eueab4gju@4ax.com>
Nathan Keel wrote:
>Ed Jay wrote:
>
>> J. Gleixner wrote:
>>
>>>Ed Jay wrote:
>>>> I'm still a novice at Perl. I'm trying to develop a simple script to
>>>> download a set of files from my server to my local drive. Although
>>>> I'm not getting any error messages, the script isn't performing.
>>>> Help, please!
>>>>
>>>> (BTW, using this script I have been able to change and delete file
>>>> names on the server, so I know I'm properly logged in.)
>>>>
>>>> My script:
>>>>
>>>> use CGI ':standard';
>>>> use CGI::Carp qw(fatalsToBrowser);
>>>You know what that does, right?
>>
>> AFAIK, it prints the error messages to the screen.
>>>
>>>> my $query = new CGI;
>>>When you use :standard, you don't need to do that.
>>
>> Thanks.
>>>
>>>> use Net::FTP;
>>>
>>>use strict;
>>>
>>>>
>>>> my $home = 'myDomain';
>>>> my $directory="public_html/uploads";
>>>> my $fileTest = "Test.IRI";
>>>
>>>You may use single quotes there, to be consistent.
>>>
>>>> my $localDir = 'F:/_Downloads';
>>>>
>>>> print "Content-type: text/html\n\n";
>>>
>>>You're not 'print'ing any HTML.
>>
>> Actually, I am, only I didn't include it, as it's not relevant to my
>> question.
>>>
>>>>
>>>> $ftp=Net::FTP->new($host,Timeout=>240,Debug =>1,Passive=>1) or
>>>> $error=1;
>>>Why are you not using
>>>
>>>my $ftp = ..
>>>
>>>there?
>>>
>> I almost never use 'my.'
>>>
>>>> push @ERRORS, "Can't ftp to $host: $!\n" if $error;
>>>
>>>According to the documentation, $@ is what you want to use, not $!.
>>>$ftp = Net::FTP->new("some.host.name", Debug => 0)
>>> or die "Cannot connect to some.host.name: $@";
>>>
>> Thanks.
>>>
>>>> if ($error) {push @ERRORS, "Can't connect to $host:
>>>> $!\n";myerrors();}
>>>> print "Connected<br>\n";
>>>>
>>>> $ftp->login("myusername","mypassword") or $error=1;
>>>> if ($error) {push @ERRORS, "Can't login to $host: $!\n";myerrors();}
>>>
>>>Again, according to documentation, use the 'message' method:
>>>$ftp->login("anonymous",'-anonymous@')
>>> or die "Cannot login ", $ftp->message;
>>>>
>>>> $ftp->cwd($directory) or $error=1;
>>>> if ($error) {push @ERRORS, "Can't cd $!\n";myerrors();}
>>>> print "Successfully logged in to folder<br><br>\n";
>>>Use 'message' method there, and in the rest of the program.
>>>
>> Thanks, again. Everything has been changed to:
>> $ftp->(do something) or die "Cannot xxx", $ftp->message;
>>>>
>>>> chdir($localDir);
>>>
>>>What if that fails?
>>>
>> Hammer meet nail! I added the error message trap, an lo, I get an
>> error message saying it can't change the local directory. Doesn't tell
>> me why, only what the path is on the server.
>>>>
>>>> $ftp->binary();
>>>>
>>>> $ftp->pasv ();
>>>>
>>>> $ftp->get($fileTest) or $error=1;
>>>> if ($error) {push @ERRORS, "Can't get file $!\n";myerrors();}
>>>> print "Successfully downloaded $fileTest<br><br>\n";
>>>>
>>>> @files=$ftp->ls() or $error=1;
>>>> if ($error) {push @ERRORS, "Can't get file list
>>>> $!\n";myerrorsors();}
>>>>
>>>> foreach(@files) {print "$_<br>\n";}
>>>>
>>>> print "<br>\n";
>>>> $ftp->quit;
>>>
>>>> exit 0;
>>>That exit isn't needed.
>>>
>> I added this as a 'safety device.'
>>>>
>>>> sub myerrorsors {$ftp->quit;print "Error: \n";print @ERRORS;exit 0;}
>>>>
>>>> Thanks in advance for your direction,
>>>>
>>>
>>>Hopefully, after using the correct methods to display errors, and/or
>>>using the Debug parameter, it'll help. Also, first get it working
>>>without running as a CGI.
>>
>> I removed the CGI reference, but get the same error.
>>
>It's not just removing the reference. How are you running it? Did you
>add the other error checking and see anything new reported?
I added the other (err...correct) error checking, and the only error was
changing the local directory.
I don't think the CGI module is doing anything, except sending the (its)
error messages to the screen.
I tried cheating the inability to change local directories by adding the
local filename with a path to the get directive, i.e.,
ftp->get($fileTest, "C:\$fileTest"), but to no avail, although
I get no error messages.
What do you mean 'how am I running it??'
--
Ed Jay (remove 'M' to reply by email)
Win the War Against Breast Cancer.
Knowing the facts could save your life.
http://www.breastthermography.info
------------------------------
Date: Mon, 04 May 2009 17:30:47 -0700
From: Nathan Keel <nat.k@gm.ml>
Subject: Re: Help with Net::ftp not downloading
Message-Id: <XMLLl.16899$9J5.9959@newsfe13.iad>
Ed Jay wrote:
> Nathan Keel wrote:
>
>>Ed Jay wrote:
>>
>>> J. Gleixner wrote:
>>>
>>>>Ed Jay wrote:
>>>>> I'm still a novice at Perl. I'm trying to develop a simple script
>>>>> to download a set of files from my server to my local drive.
>>>>> Although I'm not getting any error messages, the script isn't
>>>>> performing. Help, please!
>>>>>
>>>>> (BTW, using this script I have been able to change and delete file
>>>>> names on the server, so I know I'm properly logged in.)
>>>>>
>>>>> My script:
>>>>>
>>>>> use CGI ':standard';
>>>>> use CGI::Carp qw(fatalsToBrowser);
>>>>You know what that does, right?
>>>
>>> AFAIK, it prints the error messages to the screen.
>>>>
>>>>> my $query = new CGI;
>>>>When you use :standard, you don't need to do that.
>>>
>>> Thanks.
>>>>
>>>>> use Net::FTP;
>>>>
>>>>use strict;
>>>>
>>>>>
>>>>> my $home = 'myDomain';
>>>>> my $directory="public_html/uploads";
>>>>> my $fileTest = "Test.IRI";
>>>>
>>>>You may use single quotes there, to be consistent.
>>>>
>>>>> my $localDir = 'F:/_Downloads';
>>>>>
>>>>> print "Content-type: text/html\n\n";
>>>>
>>>>You're not 'print'ing any HTML.
>>>
>>> Actually, I am, only I didn't include it, as it's not relevant to my
>>> question.
>>>>
>>>>>
>>>>> $ftp=Net::FTP->new($host,Timeout=>240,Debug =>1,Passive=>1) or
>>>>> $error=1;
>>>>Why are you not using
>>>>
>>>>my $ftp = ..
>>>>
>>>>there?
>>>>
>>> I almost never use 'my.'
>>>>
>>>>> push @ERRORS, "Can't ftp to $host: $!\n" if $error;
>>>>
>>>>According to the documentation, $@ is what you want to use, not $!.
>>>>$ftp = Net::FTP->new("some.host.name", Debug => 0)
>>>> or die "Cannot connect to some.host.name: $@";
>>>>
>>> Thanks.
>>>>
>>>>> if ($error) {push @ERRORS, "Can't connect to $host:
>>>>> $!\n";myerrors();}
>>>>> print "Connected<br>\n";
>>>>>
>>>>> $ftp->login("myusername","mypassword") or $error=1;
>>>>> if ($error) {push @ERRORS, "Can't login to $host:
>>>>> $!\n";myerrors();}
>>>>
>>>>Again, according to documentation, use the 'message' method:
>>>>$ftp->login("anonymous",'-anonymous@')
>>>> or die "Cannot login ", $ftp->message;
>>>>>
>>>>> $ftp->cwd($directory) or $error=1;
>>>>> if ($error) {push @ERRORS, "Can't cd $!\n";myerrors();}
>>>>> print "Successfully logged in to folder<br><br>\n";
>>>>Use 'message' method there, and in the rest of the program.
>>>>
>>> Thanks, again. Everything has been changed to:
>>> $ftp->(do something) or die "Cannot xxx", $ftp->message;
>>>>>
>>>>> chdir($localDir);
>>>>
>>>>What if that fails?
>>>>
>>> Hammer meet nail! I added the error message trap, an lo, I get an
>>> error message saying it can't change the local directory. Doesn't
>>> tell me why, only what the path is on the server.
>>>>>
>>>>> $ftp->binary();
>>>>>
>>>>> $ftp->pasv ();
>>>>>
>>>>> $ftp->get($fileTest) or $error=1;
>>>>> if ($error) {push @ERRORS, "Can't get file $!\n";myerrors();}
>>>>> print "Successfully downloaded $fileTest<br><br>\n";
>>>>>
>>>>> @files=$ftp->ls() or $error=1;
>>>>> if ($error) {push @ERRORS, "Can't get file list
>>>>> $!\n";myerrorsors();}
>>>>>
>>>>> foreach(@files) {print "$_<br>\n";}
>>>>>
>>>>> print "<br>\n";
>>>>> $ftp->quit;
>>>>
>>>>> exit 0;
>>>>That exit isn't needed.
>>>>
>>> I added this as a 'safety device.'
>>>>>
>>>>> sub myerrorsors {$ftp->quit;print "Error: \n";print @ERRORS;exit
>>>>> 0;}
>>>>>
>>>>> Thanks in advance for your direction,
>>>>>
>>>>
>>>>Hopefully, after using the correct methods to display errors, and/or
>>>>using the Debug parameter, it'll help. Also, first get it working
>>>>without running as a CGI.
>>>
>>> I removed the CGI reference, but get the same error.
>>>
>>It's not just removing the reference. How are you running it? Did
>>you add the other error checking and see anything new reported?
>
> I added the other (err...correct) error checking, and the only error
> was changing the local directory.
>
> I don't think the CGI module is doing anything, except sending the
> (its) error messages to the screen.
>
> I tried cheating the inability to change local directories by adding
> the local filename with a path to the get directive, i.e.,
>
> ftp->get($fileTest, "C:\$fileTest"), but to no avail, although
> I get no error messages.
>
> What do you mean 'how am I running it??'
>
I meant "how are you running it", as in if you were running it from the
command line, another program/command/application spawning the script,
an automated process (cron/at, etc.) or if it was done on a web server
via CGI (as you were originally using the CGI module and outputting
headers), so I wanted to be sure.
------------------------------
Date: Mon, 04 May 2009 17:59:22 -0700
From: Ed Jay <edMbj@aes-intl.com>
Subject: Re: Help with Net::ftp not downloading
Message-Id: <ao3vv4lv30b15pdq1oj544da25e6euglih@4ax.com>
Nathan Keel wrote:
>Ed Jay wrote:
>
>> Nathan Keel wrote:
>>
>>>Ed Jay wrote:
>>>
>>>> J. Gleixner wrote:
>>>>
>>>>>Ed Jay wrote:
>>>>>> I'm still a novice at Perl. I'm trying to develop a simple script
>>>>>> to download a set of files from my server to my local drive.
>>>>>> Although I'm not getting any error messages, the script isn't
>>>>>> performing. Help, please!
>>>>>>
>>>>>> (BTW, using this script I have been able to change and delete file
>>>>>> names on the server, so I know I'm properly logged in.)
>>>>>>
>>>>>> My script:
>>>>>>
>>>>>> use CGI ':standard';
>>>>>> use CGI::Carp qw(fatalsToBrowser);
>>>>>You know what that does, right?
>>>>
>>>> AFAIK, it prints the error messages to the screen.
>>>>>
>>>>>> my $query = new CGI;
>>>>>When you use :standard, you don't need to do that.
>>>>
>>>> Thanks.
>>>>>
>>>>>> use Net::FTP;
>>>>>
>>>>>use strict;
>>>>>
>>>>>>
>>>>>> my $home = 'myDomain';
>>>>>> my $directory="public_html/uploads";
>>>>>> my $fileTest = "Test.IRI";
>>>>>
>>>>>You may use single quotes there, to be consistent.
>>>>>
>>>>>> my $localDir = 'F:/_Downloads';
>>>>>>
>>>>>> print "Content-type: text/html\n\n";
>>>>>
>>>>>You're not 'print'ing any HTML.
>>>>
>>>> Actually, I am, only I didn't include it, as it's not relevant to my
>>>> question.
>>>>>
>>>>>>
>>>>>> $ftp=Net::FTP->new($host,Timeout=>240,Debug =>1,Passive=>1) or
>>>>>> $error=1;
>>>>>Why are you not using
>>>>>
>>>>>my $ftp = ..
>>>>>
>>>>>there?
>>>>>
>>>> I almost never use 'my.'
>>>>>
>>>>>> push @ERRORS, "Can't ftp to $host: $!\n" if $error;
>>>>>
>>>>>According to the documentation, $@ is what you want to use, not $!.
>>>>>$ftp = Net::FTP->new("some.host.name", Debug => 0)
>>>>> or die "Cannot connect to some.host.name: $@";
>>>>>
>>>> Thanks.
>>>>>
>>>>>> if ($error) {push @ERRORS, "Can't connect to $host:
>>>>>> $!\n";myerrors();}
>>>>>> print "Connected<br>\n";
>>>>>>
>>>>>> $ftp->login("myusername","mypassword") or $error=1;
>>>>>> if ($error) {push @ERRORS, "Can't login to $host:
>>>>>> $!\n";myerrors();}
>>>>>
>>>>>Again, according to documentation, use the 'message' method:
>>>>>$ftp->login("anonymous",'-anonymous@')
>>>>> or die "Cannot login ", $ftp->message;
>>>>>>
>>>>>> $ftp->cwd($directory) or $error=1;
>>>>>> if ($error) {push @ERRORS, "Can't cd $!\n";myerrors();}
>>>>>> print "Successfully logged in to folder<br><br>\n";
>>>>>Use 'message' method there, and in the rest of the program.
>>>>>
>>>> Thanks, again. Everything has been changed to:
>>>> $ftp->(do something) or die "Cannot xxx", $ftp->message;
>>>>>>
>>>>>> chdir($localDir);
>>>>>
>>>>>What if that fails?
>>>>>
>>>> Hammer meet nail! I added the error message trap, an lo, I get an
>>>> error message saying it can't change the local directory. Doesn't
>>>> tell me why, only what the path is on the server.
>>>>>>
>>>>>> $ftp->binary();
>>>>>>
>>>>>> $ftp->pasv ();
>>>>>>
>>>>>> $ftp->get($fileTest) or $error=1;
>>>>>> if ($error) {push @ERRORS, "Can't get file $!\n";myerrors();}
>>>>>> print "Successfully downloaded $fileTest<br><br>\n";
>>>>>>
>>>>>> @files=$ftp->ls() or $error=1;
>>>>>> if ($error) {push @ERRORS, "Can't get file list
>>>>>> $!\n";myerrorsors();}
>>>>>>
>>>>>> foreach(@files) {print "$_<br>\n";}
>>>>>>
>>>>>> print "<br>\n";
>>>>>> $ftp->quit;
>>>>>
>>>>>> exit 0;
>>>>>That exit isn't needed.
>>>>>
>>>> I added this as a 'safety device.'
>>>>>>
>>>>>> sub myerrorsors {$ftp->quit;print "Error: \n";print @ERRORS;exit
>>>>>> 0;}
>>>>>>
>>>>>> Thanks in advance for your direction,
>>>>>>
>>>>>
>>>>>Hopefully, after using the correct methods to display errors, and/or
>>>>>using the Debug parameter, it'll help. Also, first get it working
>>>>>without running as a CGI.
>>>>
>>>> I removed the CGI reference, but get the same error.
>>>>
>>>It's not just removing the reference. How are you running it? Did
>>>you add the other error checking and see anything new reported?
>>
>> I added the other (err...correct) error checking, and the only error
>> was changing the local directory.
>>
>> I don't think the CGI module is doing anything, except sending the
>> (its) error messages to the screen.
>>
>> I tried cheating the inability to change local directories by adding
>> the local filename with a path to the get directive, i.e.,
>>
>> ftp->get($fileTest, "C:\$fileTest"), but to no avail, although
>> I get no error messages.
>>
>> What do you mean 'how am I running it??'
>>
>I meant "how are you running it", as in if you were running it from the
>command line, another program/command/application spawning the script,
>an automated process (cron/at, etc.) or if it was done on a web server
>via CGI (as you were originally using the CGI module and outputting
>headers), so I wanted to be sure.
I'm running a script on the server using my browser.
--
Ed Jay (remove 'M' to reply by email)
Win the War Against Breast Cancer.
Knowing the facts could save your life.
http://www.breastthermography.info
------------------------------
Date: 05 May 2009 00:22:51 GMT
From: "David Formosa (aka ? the Platypus)" <dformosa@usyd.edu.au>
Subject: Re: Perl is too slow - A statement
Message-Id: <slrngvv1m7.l51.dformosa@localhost.localdomain>
On Mon, 04 May 2009 09:45:55 -0700, Nathan Keel <nat.k@gm.ml> wrote:
> David Formosa (aka ? the Platypus) wrote:
>
>> On Sun, 03 May 2009 22:37:30 -0700, Nathan Keel <nat.k@gm.ml> wrote:
>>> David Formosa (aka ? the Platypus) wrote:
>>>
>>>> On Wed, 29 Apr 2009 20:33:23 -0700, Nathan Keel <nat.k@gm.ml> wrote:
>>>> [...]
>>>>
>>>>> What happens when you find that the language isn't fast enough?
>>>>
>>>> Lanauges are not fast or slow enough. Applications arn't fast
>>>> enought.
>>>
>>> I don't know what "Lanauges" are, so I'll take your word for it.
>>
>> Real classy a spelling flame. Like I haven't seen one of thouse
>> before.
>>
>> http://quollified.com/~platypus/index.html
>
> I resorted to picking on the typos because the response you made didn't
> make sense, even when the spelling was corrected. I didn't take the
> reply seriously, it looked like you were just posting nonsense for the
> sake of it, so I poked fun. If you were genuine, then please elaborate
> and accept my apologies for my assumption.
Ok your claim was "What happens when you find that the language isn't
fast enough?". My responce was that this question didn't make sence.
Because languages are not what is fast or slow, applications are fast
and slow.
"What happens when you find that application" isn't fast enought is a
far more fruitful question.
------------------------------
Date: Mon, 04 May 2009 17:28:11 -0700
From: Nathan Keel <nat.k@gm.ml>
Subject: Re: Perl is too slow - A statement
Message-Id: <wKLLl.16898$9J5.11479@newsfe13.iad>
David Formosa (aka ? the Platypus) wrote:
> On Mon, 04 May 2009 09:45:55 -0700, Nathan Keel <nat.k@gm.ml> wrote:
>> David Formosa (aka ? the Platypus) wrote:
>>
>>> On Sun, 03 May 2009 22:37:30 -0700, Nathan Keel <nat.k@gm.ml> wrote:
>>>> David Formosa (aka ? the Platypus) wrote:
>>>>
>>>>> On Wed, 29 Apr 2009 20:33:23 -0700, Nathan Keel <nat.k@gm.ml>
>>>>> wrote:
>>>>> [...]
>>>>>
>>>>>> What happens when you find that the language isn't fast enough?
>>>>>
>>>>> Lanauges are not fast or slow enough. Applications arn't fast
>>>>> enought.
>>>>
>>>> I don't know what "Lanauges" are, so I'll take your word for it.
>>>
>>> Real classy a spelling flame. Like I haven't seen one of thouse
>>> before.
>>>
>>> http://quollified.com/~platypus/index.html
>>
>> I resorted to picking on the typos because the response you made
>> didn't
>> make sense, even when the spelling was corrected. I didn't take the
>> reply seriously, it looked like you were just posting nonsense for
>> the
>> sake of it, so I poked fun. If you were genuine, then please
>> elaborate and accept my apologies for my assumption.
>
> Ok your claim was "What happens when you find that the language isn't
> fast enough?". My responce was that this question didn't make sence.
> Because languages are not what is fast or slow, applications are fast
> and slow.
Certain languages will run faster than others. Precompiled languages,
for example, and thus C will run faster than Perl. So, if the slowness
of Perl could be remedied and be more efficient if re-worked in quality
C code, it could solve the problem. Additionally, this is something
that can be decided in the pre development stage, is what I was saying.
In other words, if Perl is causing too much overhead, you might not
need to only have the option of getting a faster system to resolve the
problem.
> "What happens when you find that application" isn't fast enought is a
> far more fruitful question.
The design of the application is important, and the language selection
might be, too, it all depends. An application built using a very slow
language that's not well designed for the function, would show it was a
language choice, where it could be developed in another language and
you'd not have that problem. Of course there are many variables that
play a role in that and the system still matters, how you utilize the
processing, the platform, etc., but language choice is still valid in
some scenarios.
------------------------------
Date: Mon, 04 May 2009 20:58:19 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Perl OLE Excel 2003 Problem with freezepane,
Message-Id: <Xns9C01ACA6527F5asu1cornelledu@127.0.0.1>
Graig <g4774g@gmail.com> wrote in news:116f3dba-0e20-4a1e-b700-
3b404d9ab40b@k9g2000pra.googlegroups.com:
> On Windows XP, perl 5.10, Excel 2003, Win32 OLE.
>
> No problems with perl creating an Excel spreadsheet, everything seems
> to work quite well. The two problem that still remains is:
>
> 1) I am trying to freeze pane at row 2:
>
> my $freeze_panes = $gExcel->ActiveSheet->Range("2:2")->Select;
> #$gSheet->Cells(2,2)->Select();
> $gExcel->ActiveSheet->{FreezePanes} = $TRUE;
Selecting does not help. You have to tell Excel the row and column where
the split should occur. See below.
> 2) The second problem is that I want to detect if when starting my
> script, is Excel already running? What can happen is that the user
> abnormally terminates, and leaves a copy of Excel in memory. The only
> way to detect this is using MS Task Manager, and kill the excel
> process. I'd like my perl script to see if excel is running when it
> first comes up, so that I can prompt the user to close excel...
Why do you want the user to close Excel? You can instead just get the
already running instance.
#!/usr/bin/perl
use strict;
use warnings;
use File::Spec::Functions qw( catfile );
use Win32::OLE;
use Win32::OLE::Const 'Microsoft Excel';
$Win32::OLE::Warn = 3;
my $excel = get_excel();
$excel->{Visible} = 1;
my $book = $excel->Workbooks->Add;
my $sheet = $book->Worksheets->Add;
$excel->ActiveWindow->{SplitRow} = 0;
$excel->ActiveWindow->{SplitColumn} = 2;
$excel->ActiveWindow->{FreezePanes} = 1;
$book->SaveAs(catfile $ENV{TEMP}, 'test.xls');
$book->Close(0);
sub get_excel {
my $excel;
eval {
$excel = Win32::OLE->GetActiveObject('Excel.Application');
warn "got already active Excel\n";
};
die "$@\n" if $@;
unless(defined $excel) {
$excel = Win32::OLE->new('Excel.Application',
sub { $_[0]->Quit }
) or die "Oops, cannot start Excel: ",
Win32::OLE->LastError, "\n";
}
return $excel;
}
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Mon, 04 May 2009 21:00:19 GMT
From: "A. Sinan Unur" <1usa@llenroc.ude.invalid>
Subject: Re: Test post, no longer available?
Message-Id: <Xns9C01ACFD3C69Basu1cornelledu@127.0.0.1>
Nathan Keel <nat.k@gm.ml> wrote in news:TtFLl.21192$ew.1422@newsfe24.iad:
> rabbits77 wrote:
>
>> sln@netherlands.com wrote:
>>> On Sun, 03 May 2009 12:50:43 -0700, sln@netherlands.com wrote:
...
> I think they've shown they are abusive enough that the group
> would benefit if they would just go away and never come back.
It had already shown that. It had already been buried in killfiles. The
only reason I see messages from it is because you keep replying to them.
*Sigh*
Sinan
--
A. Sinan Unur <1usa@llenroc.ude.invalid>
(remove .invalid and reverse each component for email address)
comp.lang.perl.misc guidelines on the WWW:
http://www.rehabitation.com/clpmisc/
------------------------------
Date: Mon, 04 May 2009 14:26:45 -0700
From: Nathan Keel <nat.k@gm.ml>
Subject: Re: Test post, no longer available?
Message-Id: <q4JLl.39217$HZ1.25839@newsfe15.iad>
A. Sinan Unur wrote:
> Nathan Keel <nat.k@gm.ml> wrote in
> news:TtFLl.21192$ew.1422@newsfe24.iad:
>
>> rabbits77 wrote:
>>
>>> sln@netherlands.com wrote:
>>>> On Sun, 03 May 2009 12:50:43 -0700, sln@netherlands.com wrote:
>
> ...
>> I think they've shown they are abusive enough that the group
>> would benefit if they would just go away and never come back.
>
> It had already shown that. It had already been buried in killfiles.
> The only reason I see messages from it is because you keep replying to
> them.
>
> *Sigh*
>
> Sinan
>
*Sigh*
This isn't that big of a deal. You'll see that I myself had killfiled
him. My response you saw was in reply to the rabbits77 poster. I'm
not trying to ruin your enjoyment of the group, but if you're worried
about seeing someone's posts that you've filtered, I'm sure you can
immediately see who was quoted and move on, or if you have a problem
with me quoting him in my 4 replies in total yesterday where I
mentioned killfilling him, then I won't be upset if you kill file me,
too, if it's that much of a concern.
I "get" that it's annoying, but I'm not exactly propagating his posts
with a few replies the other day, and having killfiled him (again)
myself. Of course, he'll be back on a new news server and posting with
another address, so you'll probably see his own posts when he returns,
until you killfile him again. Personally, I killfile people so I don't
have to read their posts, and if someone quotes them, it's usually not
a big deal for me.
------------------------------
Date: Mon, 4 May 2009 17:00:51 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Test post, no longer available?
Message-Id: <slrngvupcj.4g7.tadmc@tadmc30.sbcglobal.net>
Nathan Keel <nat.k@gm.ml> wrote:
> I won't be upset if you kill file me,
In you go then. You've earned it.
> I killfile people so I don't
> have to read their posts,
Me too.
See above.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Mon, 04 May 2009 16:05:00 -0700
From: Nathan Keel <nat.k@gm.ml>
Subject: Re: Test post, no longer available?
Message-Id: <wwKLl.29263$vj3.25892@newsfe01.iad>
Tad J McClellan wrote:
> Nathan Keel <nat.k@gm.ml> wrote:
>
>> I won't be upset if you kill file me,
>
>
> In you go then. You've earned it.
God forbid anyone actually discuss something.
>> I killfile people so I don't
>> have to read their posts,
>
>
> Me too.
>
> See above.
What a child you must be to throw a tantrum and make some futile point,
because I told someone that they needn't worry about me replying to
someone they've blocked, since I've also recently blocked them, and if
it's too much to handle, to block my posts, too. Sad that someone
actually thinks it's needed so make their sarcastic points.
------------------------------
Date: Mon, 4 May 2009 17:11:53 -0500
From: Tad J McClellan <tadmc@seesig.invalid>
Subject: Re: Unbelievable, Easy News trashes arbitrary message bodies from Perl groups
Message-Id: <slrngvuq19.4g7.tadmc@tadmc30.sbcglobal.net>
Nathan Keel <nat.k@gm.ml> wrote:
> killfile me as if I'm some problem,
You _are_ a problem.
Doesn't earning multiple plonks make you wonder if that might
actually be true?
Nah. It's probably a well coordinated conspiracy.
You are fine. It is everybody else that has a problem.
--
Tad McClellan
email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
------------------------------
Date: Mon, 04 May 2009 16:09:05 -0700
From: Nathan Keel <nat.k@gm.ml>
Subject: Re: Unbelievable, Easy News trashes arbitrary message bodies from Perl groups
Message-Id: <lAKLl.29290$vj3.8093@newsfe01.iad>
Henry Law wrote:
> Nathan Keel wrote:
>> you have a problem. Guess what, I don't put up with your arrogant
>> crap anymore
>
> Guess what, Mr Keel: Sherm didn't read what you wrote (that's what he
> meant by "plonk", by the way) but the rest of us did. And I doubt
> we're much better off from the experience.
>
I know what he meant, and I know he was acting like a child trying to
get the "last word". The point of the reply was to speak my thoughts
as well, just like he did. Just like I'm doing now. It's sort of
sadly ironic that this is what some people would use for a reason to
block another person. "Let's discuss it and ridicule you and insult
you, but when you reply to my sarcastic post to say you've blocked
someone, too and it's not a bad deal, so we can say "you suck, I'm
blocking you, now *plonk*"". Why even use usenet if it's just about
sarcasm and blocking because people are doing what it's designed for
(being communication with each other). And, no, I'm not going to say
"Now I'm blocking you" because I don't actually feel those people are a
threat, and I can just not read their posts. No reason to go to the
extreme and act like someone's being harassing and they need to block
them because they are so freaking filter-happy and want to get their
last sarcastic comment and tell me how they've "blocked me" (else
they'd not bother). It's just childish.
------------------------------
Date: Mon, 04 May 2009 16:14:06 -0700
From: Nathan Keel <nat.k@gm.ml>
Subject: Re: Unbelievable, Easy News trashes arbitrary message bodies from Perl groups
Message-Id: <3FKLl.29324$vj3.13506@newsfe01.iad>
Tad J McClellan wrote:
> Nathan Keel <nat.k@gm.ml> wrote:
>
>> killfile me as if I'm some problem,
>
>
> You _are_ a problem.
Grow up.
> Doesn't earning multiple plonks make you wonder if that might
> actually be true?
No, because these people have "plonked" me and made a sarcastic or
insulting remark for no reason, yet they think they look wise for
saying such things. Just freaking block someone if you want to block
them, don't get in your little last attempt to "out do" them. The only
thing that earned me a "plonk" was that I replied to someone they
blocked before, and I replied saying it's not a big deal, I've since
blocked the person myself, so they won't *gasp* risk seeing my reply to
that person either. That in itself has "earned me a plonk". That's
pretty stupid.
> Nah. It's probably a well coordinated conspiracy.
Oh, and now this reply to your childish and sarcastic comment will have
someone else "plonk" me. So what? I never suggested any "conspiracy",
I know why people are irrationally blocking me. It's funny, because I'm
being blocked for replying to comments like yours. This is a big
threat to people's activity on this group?
> You are fine. It is everybody else that has a problem.
I never suggested any such thing. You're just being a jackass because
you think you're more important than other people. I'm the guy that
invited anyone that's so flipped out about me replying to someone that
posted to me, to block me. Does that sound like I really give a rats
ass if you or anyone else blocks my posts or that I care, or that I
think it's some conspiracy? Honestly, you're failed in your attempts
to make a witty sarcastic remark.
------------------------------
Date: Mon, 04 May 2009 23:03:40 +0100
From: Henry Law <news@lawshouse.org>
Subject: Re: Unbelievable, Easy News trashes arbitrary message bodies from Perl groups
Message-Id: <1241474886.25893.0@proxy01.news.clara.net>
Nathan Keel wrote:
> you have a problem. Guess what, I don't put up with your arrogant crap
> anymore
Guess what, Mr Keel: Sherm didn't read what you wrote (that's what he
meant by "plonk", by the way) but the rest of us did. And I doubt we're
much better off from the experience.
--
Henry Law Manchester, England
------------------------------
Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin)
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>
Administrivia:
#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc. For subscription or unsubscription requests, send
#the single line:
#
# subscribe perl-users
#or:
# unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.
NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice.
To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.
#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.
#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.
------------------------------
End of Perl-Users Digest V11 Issue 2391
***************************************