Re: if element exists in an array

2016-08-19 Thread Chas. Owens
On Fri, Aug 19, 2016 at 2:22 PM Chas. Owens wrote: > Truth. If you are checking in lots of things exist a hashset might be a > better way to go: > > my %hashset = map { ($_ => undef) } (3,1,4,2,9,0); > > my $found = exists $hashset{4} || 0; > my $not_found = exists $hashset{10} || 0; > > By sett

Re: if element exists in an array

2016-08-19 Thread Chas. Owens
Truth. If you are checking in lots of things exist a hashset might be a better way to go: my %hashset = map { ($_ => undef) } (3,1,4,2,9,0); my $found = exists $hashset{4} || 0; my $not_found = exists $hashset{10} || 0; By setting the value of the hash to be undef, you take up less space than s

Re: if element exists in an array

2016-08-19 Thread wagsworld48 via beginners
But does it need to be an array. Rethink into hash and life could be a little bit easier... Wags ;) WagsWorld Hebrews 4:15 Ph: 408-914-1341 On Aug 18, 2016, 19:41 -0700, kp...@freenet.de, wrote: > Thanks for all the replies. > Yes I found List::Util is a useful toolset. > > > On 2016/8/19 10:00,

Re: Net::FTP ALLO --- and how to advise functions in perl

2016-08-19 Thread Chas. Owens
If you want to get rid of ALLO completely, it looks like you just need to monkeypatch Net::FTP::_ALLO to return 1: use Net::FTP; BEGIN { no warnings "redefine"; *Net::FTP::_ALLO = sub { 1 }; } This replaces the _ALLO method of Net::FTP with a new method that just returns 1. I set it up l

Re: Net::FTP ALLO --- and how to advise functions in perl

2016-08-19 Thread hw
Chas. Owens schrieb: Based on a cursory reading of the perldoc, it looks like the ALLO command is only sent if you call the Net::FTP::alloc method. If you aren't calling it, can you provide a toy test case for us where the code sends ALLO. I will try to debug why it is sending a command you

Re: Net::FTP ALLO

2016-08-19 Thread Chas. Owens
Based on a cursory reading of the perldoc, it looks like the ALLO command is only sent if you call the Net::FTP::alloc method. If you aren't calling it, can you provide a toy test case for us where the code sends ALLO. I will try to debug why it is sending a command you aren't asking for. If you

Net::FTP ALLO

2016-08-19 Thread hw
Hi, is there some way to prevent Net::FTP from using the ALLO command or to make it ignore failures when this command is used? I have to deal with ftp servers that do not understand the ALLO command. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beg