Re: First line of input file not accessible.

2024-07-17 Thread David Precious
On Wed, 17 Jul 2024 17:41:22 +1000 Peter West via beginners wrote: [...] > $ cat print_file > #!/usr/bin/perl -n > while (<>) { > print "$. $_"; > } > exit; [...] > What happened to line 1? It's eaten by the `while (<>) { ... }` loop that is wrapped around your program because you used `-n` i

Re: Please help: perl run out of memory

2022-04-27 Thread David Emanuel da Costa Santiago
ler to figure it out where the most memory is being consumed... Good luck. Regards, David Santiago -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Please help: perl run out of memory

2022-04-22 Thread David Precious
On Thu, 21 Apr 2022 07:12:07 -0700 al...@coakmail.com wrote: > OP maybe need the streaming IO for reading files. Which is what they were already doing - they used: while () { ... } Which, under the hood, uses readline, to read a line at a time. (where "HD" is their global fileh

Re: Please help: perl run out of memory

2022-04-21 Thread David Precious
On Thu, 21 Apr 2022 17:26:15 +0530 "M.N Thanishka sree Manikandan" wrote: > Hi wilson > Try this module file::slurp Given that the OP is running into memory issues processing an 80+ million line file, I don't think suggesting a CPAN module designed to read the entire contents of a file into mem

Re: Please help: perl run out of memory

2022-04-17 Thread David Mertens
make sense? I could bang out some code illustrating what I mean if that would help. David On Sun, Apr 17, 2022, 5:33 AM wilson wrote: > hello the experts, > > can you help check my script for how to optimize it? > currently it was going as "run out of memory". > > $ p

Re: Can't call method "Convolve" on unblessed reference at gifaninmation.pl line 47.

2022-02-04 Thread David Mertens
ripts cobbled together. Do you have an example of just how to convolve an image? David --%< use strict; use warnings; use Image::Magick; # The script reads three images, crops them, and writes a single image as a GIF animation sequence my($imag

Re: Can't call method "Convolve" on unblessed reference at gifaninmation.pl line 47.

2022-02-04 Thread David Mertens
The issue isn't having the method, the issue is calling it on an unblessed reference. Can you show the code that gives this problem? Btw, my bet is that it's not a matter of having PDL's method. You would use PDL for number crunching, not gif animation. :-) David On Fri, Feb 4,

Re: perl script question

2019-10-10 Thread David Precious
The error message "FASEQ can not open" doesn't look like something which could be output by the code you've provided. *Either* you should get the "can not read open $!" message (where the $! will be interpolated to the reason it failed), or the message is coming from whatever the "usearch" tool

Re: Question re remove_tree and symlinks

2019-08-24 Thread David Precious
On Fri, 23 Aug 2019 19:13:15 +0100 Mike Martin wrote: > Am I right in believing that remove_tree from File::Path does not > follow symlinks, ie: does not remove the linked file only the link if > there are links in the direstories removed An obvious way to find out would be to just try it - set

Re: Google Sheets API Data Structure

2019-08-16 Thread David Precious
On Thu, 15 Aug 2019 16:18:57 +0100 James Kerwin wrote: > I'm currently investigating a data structure that it gives me to see > what values I can get from it. Through random experimentation I've > managed to find that it had "title" and "id". > > I wrote this to get the data structure containing

Re: Device::SerialPort on debian Buster

2019-07-11 Thread David Precious
On Wed, 10 Jul 2019 08:51:08 -0500 "Martin McCormick" wrote: > The code below talks to what it thinks is a RS-232 serial > port and controlls a radio scanner so that one can program the > scanner's settings and enter frequency and operational data. > Don't worry about all that. It used to w

Re: proper use of TEMPLATE

2019-03-19 Thread David Precious
On Thu, 14 Mar 2019 12:14:59 -0500 Rick T wrote: > Full Course (1 > credit) > > My code can easily replace the correct var with ‘selected’ and the > other vars on the list with a blank. But what should that blank be? > > Should I make it an empty string, a space, undef, or something else? An e

Re: covert perl code to binary

2019-01-11 Thread David Mertens
How dumb is your "nobody"? Would Acme::Bleach do the trick? Or something similar? :) On Fri, Jan 11, 2019, 5:01 AM Uday Vernekar Hi all, > > I have a perl code which I need to covert to binary so that nobody can see > the code. > > we used pp package to make the perl code binary but here the use

Re: Syntax "||" before sub

2018-11-24 Thread David Precious
On Thu, 22 Nov 2018 12:33:25 -0800 "John W. Krahn" wrote: > On 2018-11-22 8:08 a.m., David Precious wrote: > > > > > > You'll often see these operators used to provide default values. > > > > e.g. > > > >sub hello { > &g

Re: Syntax "||" before sub

2018-11-22 Thread David Precious
On Thu, 22 Nov 2018 13:48:18 + James Kerwin wrote: > Hi All, > > I'm looking through some Perl files for software we use and I noticed > this in one of the config files: > > $c->{guess_doc_type} ||= sub { > > All other similar config files show a similar structure, but without > the "||" b

Re: Common regex for timedate

2018-11-12 Thread David Y Wagner via beginners
You could change the first portion of RegEx to \d{2}[.\-](\d{2}|\D{3})[.\-] This could cover all the valid Month codes, but this will look for the hyphen or period and two digit month or three non digits and then the the hyphen or period following. There is much more you could do, but this cove

Re: Read a huge text file in perl

2018-05-24 Thread David Precious
On Thu, 24 May 2018 20:27:23 +0530 SATYABRATA KARAN wrote: > Hello, > Does anyone guide me how to handle a huge file (>50GB) in perl? Your code should be looping line by line, and shouldn't use much memory, depending of course on how long the lines are, and what you're doing with them. It will

Re: captcha

2018-03-05 Thread David Precious
On Mon, 5 Mar 2018 11:43:48 +0700 Eko Budiharto wrote: > dear all, > > I am trying to put a captcha on my site. I already have public key > and secret key from google. I already put the public key on my html > and secret key on the server respond site. But when I ran it, I got > an error, For se

Re: Checking if a website is up doesn't work correctly

2018-02-24 Thread David Precious
On Sat, 17 Feb 2018 18:21:26 +0100 Manfred Lotz wrote: > Thanks. The attached program does better as https://notabug.org > works. Only http://scripts.sil.org doesn't work. It seems there are > special checks active on that site. Yeah, some sites block user-agents recognised as robots, scripts

Re: Can't use 'defined(@array)'

2018-02-23 Thread David Precious
On Fri, 23 Feb 2018 15:46:14 +0100 "jose cabrera" wrote: > Greetings! > > I am using perl v5.22.1, and I am debugging an old script. The code > is, > > if (defined($$glob)) { > $localconfig{$var} = $$glob; > } > elsif (defined (@$glob)) { >

Re: TLS and Perl

2018-01-25 Thread David Precious
On Thu, 25 Jan 2018 10:19:26 -0800 SurfShop wrote: > I keep getting emails from Authorize.net about their upcoming > disablement of TLS 1.0 and TLS 1.1 and I need to know if that has > anything to do with Perl or not. I don't have any code in SurfShop > that references either SSL or TLS, s

Re: Getting the results of a remote script

2017-11-09 Thread David Precious
On Thu, 9 Nov 2017 12:50:05 -0800 SSC_perl wrote: > > On Nov 8, 2017, at 5:16 PM, thelip sia wrote: > > > > you can use backtick to store the output. > > $list = `ssh usern...@domain.com > > '/usr/bin/perl /path/to/dir-list.pl'`; > > Thanks, Heince. I had mistakenly thought those were

Re: Device::SerialPort Am I Missing Something?

2017-11-04 Thread David Precious
On Fri, 03 Nov 2017 15:12:15 -0500 "Martin McCormick" wrote: > What is needed, however, is to be able to use the are_match > feature which fills a buffer with data until a pattern is > detected which stops the read and gives you a series of bytes > that may not necessarily end with a newline

Re: Problems Receiving this List

2017-11-04 Thread David Precious
On Fri, 03 Nov 2017 15:29:29 -0500 "Martin McCormick" wrote: > I just posted a message to this list about the Device::SerialPort > module. I finally saw my message reflected back to me after > quite a bit of head-scratching and some correspondence with the > list-owner address. All message traf

Re: Heredocs with \r\n on linux

2017-10-16 Thread David Santiago
I'm implementing a network protocol that is line oriented (\r\n). I thought of : my $string = <<"END"; Hello\r World\r END but i don't know how a socket printing will work in windows (i don't have one to test it) I'm writing to the socket like this: print $

Heredocs with \r\n on linux

2017-10-15 Thread David Santiago
uot;This is one line\r\nThis is another one\r\nFinal line" What's the best way of accomplishing this? I know that i can $text=~ s/\n/\r\n/; but i think it must be a better way... Best regards, David Santiago -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

Re: "Information station" using Perl and Raspberry Pi

2017-07-26 Thread David Precious
On Tue, 25 Jul 2017 12:20:44 -0700 SSC_perl wrote: > My first though was to use HTML, but I don't want to use a browser to > display the text onscreen. Would this require a GUI, such as Tk? FWIW, it might be sensible to not fully discount the HTML option - seting an RPi up to start a browser on

Re: "Information station" using Perl and Raspberry Pi

2017-07-25 Thread David Mertens
decision, but was the deciding factor for me picking BB. Good luck! Feel free to reach out either on this list or directly if you have questions! David On Tue, Jul 25, 2017 at 7:53 PM, SSC_perl wrote: > On Jul 25, 2017, at 2:08 PM, Andrew Solomon wrote: > > In case you want to see

Re: debug perl package

2017-07-17 Thread David Mertens
If you really want a GUI debugger you might consider Padre. I've used it as a debugger once or twice, but recall running into issues. Note that Padre has been a stale project for a while, so it may not even install. A safe bet, if non-gui, is the perl debugger, as already mentioned. Davi

Re: Filehandle within foreach loop

2017-07-16 Thread David Mertens
Yes, and I think that gives us *two* reasons to always explicitly close filehandles. :-) David On Sun, Jul 16, 2017 at 8:00 AM, Shawn H Corey wrote: > On Sun, 16 Jul 2017 07:36:39 -0400 > David Mertens wrote: > > > Also note that lexical filehandles close when they go out of

Re: Filehandle within foreach loop

2017-07-16 Thread David Mertens
ch expression won't close until the end of the program. David On Wed, Jul 12, 2017 at 5:28 PM, Jim Gibson wrote: > If you wish to terminate execution of a foreach loop without iterating > over all of the elements (@files, in this case) use the “last” statement: > > foreach my $file

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-07 Thread David Mertens
e string and numeric context. In particular, boolean context coerces undefined values to false without issuing warnings, and it's not clear how an undefined value would operate under "logical string negation" and "logical numeric negation". David -- "Debugging is tw

Re: perl -e 'my $i = 0; $i = defined($i) ? (!!$i) : 0; print "i: $i\n";'

2017-07-06 Thread David Mertens
t, but the negation operator does---boolean---and so we get a result that is boolean true or false, both of which are represented by special kinds of dual-vars, as was already explained. David -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write t

Re: Module to extract patterns

2017-06-13 Thread David Mertens
See also Text::Balanced and its extract_quotelike: http://search.cpan.org/~shay/Text-Balanced-2.03/lib/Text/Balanced.pm#extract_quotelike David On Tue, Jun 13, 2017 at 7:23 AM, Paul Johnson wrote: > On Tue, Jun 13, 2017 at 02:03:10PM +0300, Lars Noodén wrote: > > There are a lot o

Re: How to match words with a consecutive character

2017-05-06 Thread David Emanuel da Costa Santiago
Thanks! I didn't knew that feature. It's very cool! Thank you very much. Best regards, David Santiago On Sat, 6 May 2017 23:03:48 +0100 David Precious wrote: > On Sat, 6 May 2017 23:13:04 +0200 > David Emanuel da Costa Santiago wrote: > > Is there any regular expr

Re: How to match words with a consecutive character

2017-05-06 Thread David Precious
On Sat, 6 May 2017 23:13:04 +0200 David Emanuel da Costa Santiago wrote: > Is there any regular expression, that can match any consecutive > character? You want to use a back-reference - e.g. /(.)\1+/ matches any character followed by one or more of that same character. Demo: [

How to match words with a consecutive character

2017-05-06 Thread David Emanuel da Costa Santiago
/[qwerty]{2,} I tried to search a solution on the internet, but i only found solutions where you need to specify a single character: q{2,} w{2,} ... Thanks and best regards, David Santiago -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h

Re: How to delete multiple indices from array

2017-04-12 Thread David Emanuel da Costa Santiago
= 1.40 CPU) @ 714285.00/s (n=99) The hash one, which was my first solution is the slowest one. :-( code and results: https://pastebin.com/FYdJzVzu Thanks all. Regards, David Santiago On Wed, 12 Apr 2017 16:50:49 -0400 Uri Guttman wrote: > On 04/12/2017 04:38 PM, Shlomi Fish wrote: >

Re: How to delete multiple indices from array

2017-04-12 Thread David Emanuel da Costa Santiago
0; splice(@array, $_-$deviation++,1) for(@indicesToDelete); -- Thank you all! Regards, David Santiago On Wed, 12 Apr 2017 15:19:33 -0400 Uri Guttman wrote: > On 04/12/2017 03:00 PM, David Emanuel da Costa Santiago wrote: > > Hello! > > > > What's the best wa

How to delete multiple indices from array

2017-04-12 Thread David Emanuel da Costa Santiago
esToDelete; @array = values(%hash); -- but this doesn't seem to me much efficient. Is there a better way to do this? Btw, for this case the order doesn't matter. Thanks! Best regards, David Santiago -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additio

Re: Problem using Email::Mailer on laptop

2017-03-20 Thread David Precious
On Mon, 20 Mar 2017 11:23:39 -0700 SSC_perl wrote: > Is anyone here successfully using Email::Mailer? I installed > it using cpanm a couple of days ago on my Mac and I can’t get it to > work. It just prints the following output and nothing more: > > postdrop: warning: mail_queue_enter: c

Re: Strange HASH(0x2ced735) values

2017-02-21 Thread David Precious
On Tue, 21 Feb 2017 09:11:10 -0800 SSC_perl wrote: > > On Feb 21, 2017, at 8:34 AM, Uri Guttman > > wrote: > > > > you can't trace it from the value. but you can write code where > > that value is stuffed into the db and look for a reference vs 1 or > > a blank. then you can dump the call stack

Re: Remove Newlines from String

2016-09-06 Thread David Emanuel da Costa Santiago
Thanks :-) A little bug: > my %HexCodes = map { ord($_) => sprintf '%02X', $_ } ( 0 .. 128 ); my %HexCodes = map { chr($_) => sprintf '%02X', $_ } ( 0 .. 128 ); -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.p

Re: Remove Newlines from String

2016-09-06 Thread David Emanuel da Costa Santiago
;This is my string! \r\n the end"; say "String before: $s"; #Change the character class you want $s =~ s/([^[:print:]])/$HEXCODES{ord($1)}/g; say "String after: $s"; END Regards, David Santiago On Tue, 6 Sep 2016 11:11:35 -0500 Matt wrote: > I am receiving

Re: file type

2016-08-24 Thread David Mertens
erl-module-turns-a-file-extension-txt-jpeg-into-a-mime-type-text-pla/22832209#22832209>, and the answer suggests MIME::Types, but also suggests some content introspection, for which File::Type and File::MimeInfo::Magic get a mention. I have never used any of these, so I cannot vouch for them myse

Re: Perl regular expression for implementing infix expression parser?

2016-08-14 Thread David Mertens
", then you can expect to get a very wide range of answers, not just regex-based. Thanks! Looking forward to the fun! David On Sat, Aug 13, 2016 at 3:45 PM, Richard Heintze via beginners < beginners@perl.org> wrote: > I this perl one liner for evaluating infix express

Re: Interpolation Problem

2016-07-17 Thread David Mertens
ly reported a line number. Could you post the code in the vicinity of that line number? (Better yet, post your whole script, or enough of a script to reproduce the problem.) Thanks! David -- "Debugging is twice as hard as writing the code in the first place. Therefore, if you write the co

Re: DBI.c: loadable library and perl binaries are mismatched

2016-06-30 Thread David Emanuel da Costa Santiago
Hi Ron. I had that problem not with the DBI module, but when i was using Inline::C. To solve that issue i had to compile my code with the gcc flag -DPERL_IMPLICIT_SYS Maybe it helps if you can recompile the bit that has the XS (or C) code with that flag? Best regards, David Santiago On

Re: having trouble understanding the built-in Perl sort with regards to mixed numbers and strings

2016-06-28 Thread David Precious
On Fri, 17 Jun 2016 14:33:12 -0700 Kenneth Wolcott wrote: > Hi; > > I'm having trouble understanding the built-in Perl sort with regards > to mixed numbers and strings > > I'm looking at http://perldoc.perl.org/functions/sort.html > > I have an array that I want to have sorted numericall

Re: Script runs slower with better hardware

2016-06-02 Thread David Santiago
s attached. Regards. David Santiago 2016-06-02 16:59 GMT+02:00 James Alton : > The laptop has better specs in terms of number of threads and memory > bandwidth. I'd also have a play around with the "perf" command if all other > software versions are the same and you want to

Re: Script runs slower with better hardware

2016-06-01 Thread David Emanuel da Costa Santiago
o know when i should write or read. CPU comparison: http://cpuboss.com/cpus/Intel-Core-i7-720QM-vs-Intel-Core-i5-6500T Regards, David Santiago On Wed, 1 Jun 2016 19:20:00 -0600 James Alton wrote: > Can you please give specs on both CPUs? (The exact manufacturer and > model.) > >

Re: Script runs slower with better hardware

2016-06-01 Thread David Emanuel da Costa Santiago
Unfortunatelly i don't have a third box. :-( I'm going to follow your advice and send an email to p5p. Thank you! Best regards, David Santiago On Wed, 1 Jun 2016 16:17:47 -0400 Uri Guttman wrote: > On 06/01/2016 04:04 PM, David Emanuel da Costa Santiago wrote: > > Hi Ken

Re: Script runs slower with better hardware

2016-06-01 Thread David Emanuel da Costa Santiago
The openssl version is 1.0.2.h. Thanks for your help. I'm going to follow Uri's advice and send an email to p5p list. Thank you! Regards, David Santiago On Thu, 2 Jun 2016 08:18:23 +1200 Kent Fredric wrote: > On 2 June 2016 at 08:04, David Emanuel da Costa Santiago > wro

Re: Script runs slower with better hardware

2016-06-01 Thread David Emanuel da Costa Santiago
imum speed using a different application. Regards, David Santiago On Thu, 2 Jun 2016 07:40:00 +1200 Kent Fredric wrote: > On 2 June 2016 at 06:25, David Emanuel da Costa Santiago > wrote: > > The question for one million dollar is "Why?". And how can i improve > >

Re: Script runs slower with better hardware

2016-06-01 Thread David Emanuel da Costa Santiago
oldest hardware runs faster. The SSLeay version is the same on both machines (version 1.72 - the latest one haven't reach the stable repos yet) Regards, David Santiago On Wed, 1 Jun 2016 22:23:51 +0300 Shlomi Fish wrote: > On Wed, 1 Jun 2016 20:25:39 +0200 > David Emanuel da Costa Santia

Re: Script runs slower with better hardware

2016-06-01 Thread David Emanuel da Costa Santiago
r applications i can reach same speed with SSL on both machines. Regards, David Santiago On Wed, 01 Jun 2016 19:36:06 +0100 Steve Pointer wrote: > Does your laptop have a TPM? > > > > On 1 June 2016 19:25:39 BST, David Emanuel da Costa Santiago > wrote: > > > >

Script runs slower with better hardware

2016-06-01 Thread David Emanuel da Costa Santiago
will that make it even? Regards, David Santiago -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Forking as another user

2016-03-11 Thread David Emanuel da Costa Santiago
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hello all. AFAIK, you can't do that. When you fork everything is copied, including the UID. To achieve something similar, you need to launch another process (but you'll need to be root to launch it as another user) Regards, David San

Re: Is perl user specific

2016-01-06 Thread David Santiago
Hello Ankita, The error says all: Perl 5.008003 required--this is only version 5.00503 You are running perl version 5.005, but the minimum version to run is 5.008. Most probably the other account on the same server have a higher perl version installed (please check perlbrew (http://perlbrew.pl/)

Re: How to interpolate a hash in a string

2015-11-04 Thread David Emanuel da Costa Santiago
: > Re-sending with CC to OP since it didn't make the group. > > On 11/3/2015 14:03, David Emanuel da Costa Santiago wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA256 > > > > > > Hello all. > > > > I'm trying to interpolate a

How to interpolate a hash in a string

2015-11-03 Thread David Emanuel da Costa Santiago
conf_file{ open my $FH, '<', shift @_; while(<$FH>){ chomp; s/\#.*//; /(\S+)\s*=\s*(.+)/; next if (!defined $1 || !defined $2); $OPTS{$1}=$2; } close $FH; } Does anybody knows how to do this? Best regards, David Santia

Re: Sockets getting stuck

2015-10-13 Thread David Emanuel da Costa Santiago
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Brandom. On Tue, 13 Oct 2015 10:08:27 -0400 Brandon McCaig wrote: > On Tue, Oct 13, 2015 at 6:34 AM, David Emanuel da Costa Santiago > wrote: > > Hi! > > Hello, > > > THanks for your suggestion. > > I

Re: Sockets getting stuck

2015-10-13 Thread David Emanuel da Costa Santiago
2015 20:50:46 -0700 $Bill wrote: > This failed twice to post - emailing it. > > On 10/12/2015 09:58, David Emanuel da Costa Santiago wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA256 > > > > > > Hello all! > > > > I'm creating s

Re: Sockets getting stuck

2015-10-12 Thread David Emanuel da Costa Santiago
ocket simply gets in zombie state. Not dead, but not alive. The connection timeout doesn't work, the receive timeout (SO_RCVTIMEO) and send timeout (SO_SNDTIMEO) does work. Is there any way to recover from this? On Mon, 12 Oct 2015 18:58:42 +0200 David Emanuel da Costa Santiago wrote: >

Sockets getting stuck

2015-10-12 Thread David Emanuel da Costa Santiago
return $output; } The same happens even with a sysread (both on windows and linux platforms). This hanging doesn't happen everytime, it's like 1 in 6 tries. If i check with netstat i see the connection with state ESTABLISHED. Do you guys know what'

Re: Perl memory leaks (and valgrind)

2015-10-02 Thread David Emanuel da Costa Santiago
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hi Shlomi I just noticed that, if i merge yenc_encode_c_for_perl with _yenc_encode_c into one function then valgrind stops reporting memory leaks. I need to do more tests though. Thanks and best regards, David Santiago On Thu, 1 Oct 2015 22

Re: Perl memory leaks (and valgrind)

2015-10-01 Thread David Emanuel da Costa Santiago
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Now with the code attached. Best regards, David Santiago On Thu, 1 Oct 2015 19:19:47 +0200 David Emanuel da Costa Santiago wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA256 > > > Hello all, > > Is the valgrind

Perl memory leaks (and valgrind)

2015-10-01 Thread David Emanuel da Costa Santiago
version is 5.22.0. Thank you and best regards, David Santiago -BEGIN PGP SIGNATURE- Version: GnuPG v2 iQEcBAEBCAAGBQJWDWszAAoJEJ/OLjwuDYzK3y0H/0bJoCx6o6xdjTb3DUuoLQIp Gyt/I7URulDEzKY9KAPWiTOECWiC12ZbqYg/dNID/p+Ap3UhOYnHTjIqs7M6Cmaz RpzFU1nF/o8gpvkC3Rjr7iLsjtZuNIbMJv

Re: reading from socket

2015-09-17 Thread David Emanuel da Costa Santiago
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Hello Chris. Can you provide the yenc files? Both the good one and the bad one? Thx, Regards, David Santiago On Thu, 17 Sep 2015 23:19:22 +0200 "Chris Knipe" wrote: > Just an example, and no, the decoder isn't written by m

Re: Yenc encoder performance

2015-07-31 Thread David Emanuel da Costa Santiago
stack overflow) http://stackoverflow.com/questions/3104493/performance-with-perl-strings I'm going to try your suggestions an i will report back. Best regards, David Santiago Em Thu, 30 Jul 2015 16:56:31 -0400 Uri Guttman escreveu: > On 07/30/2015 04:14 PM, David Emanuel da Costa Santiago wrot

Re: Yenc encoder performance

2015-07-30 Thread David Araujo Souza
Hi Shiome.I'm the very, very beginner in Perl. In moment i can't help you. I'm iniciate study in Perl on this week. Sorry. Em Quinta-feira, 30 de Julho de 2015 18:27, Shlomi Fish escreveu: Hi David, see below for my comments on your code. On Thu, 30 Jul 2015

Yenc encoder performance

2015-07-30 Thread David Emanuel da Costa Santiago
Initially i though about memoize it, but unfortunately i don't think it's possible. Replacing the for loop with a map, would be a good option? Does anybody has any idea to improve it's performance? Regards, David Santiago CODE: The following function receives a binary string. #

Re: Should I add ExtUtils::MakeMaker as prerequisite to Makefile?

2015-02-27 Thread David Precious
On Fri, 27 Feb 2015 23:41:22 +0100 Alex Becker wrote: > So my idea was to specify EUMM v6.46 as minimum in PREREQ_PM. This > way, I would not have to do all this 'if the EUMM version is greater > than X then add Y to Makefile.PL' stuff. > > So, would it work? Does it make sense? I don't think so;

Re: is faster a regexp with multiple choices or a single one with lower case?

2015-01-08 Thread David Precious
lc_first regex_nocase 2674/s -- -24% lc_first 3509/s 31% -- Of course, YMMV. -- David Precious ("bigpresh") http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb.co.uk/linkedinwww.preshweb.co.uk/facebook www.preshweb.co.uk/c

Re: Anonymous functions and safe compartments

2014-12-28 Thread David Emanuel da Costa Santiago
c("func1"); } ## The output is what i was expecting: $ perl Example.pl About to run shared function! Dangerous func1 operation! Thanks Brandon for your help. Best regards, David Santiago Em Sun, 28 Dec 2014 16:35:50 -0500 Brandon McCaig escreveu: > David: > > O

Anonymous functions and safe compartments

2014-12-28 Thread David Emanuel da Costa Santiago
unc->("func1"); } ## The output of the Example.pl script is: Error while executing the sandbox: Global symbol "$anon_func" requires explicit package name at untrusted_script.pl line 5. I was expecting of the output of the Example.pl script to be "Dangerous

Re: LDAP server

2014-12-05 Thread David Precious
an email address? Are you confusing LDAP and IMAP, by any chance? Sounds like you want to log in to an email server by IMAP to confirm the mailbox username and password are correct, not use an LDAP server. http://en.wikipedia.org/wiki/LDAP http://en.wikipedia.org/wiki/IMAP -- David Pre

Re: map vs foreach

2014-09-30 Thread David Precious
On Tue, 30 Sep 2014 14:08:14 -0700 SSC_perl wrote: > Is the output of these two lines equivalent? > > map { $hash->{$_} = shift @record } @{$self->{'FIELDNAMES'}}; > > $hash->{$_} = shift @record foreach @{$self->{'FIELDNAMES'}}; [...] > Is one more appropriate than the other in a s

Re: activity indicator

2014-09-28 Thread David Precious
On 27 Sep 2014 19:44:22 - sharda wrote: > retrieving the information from the DB in this time delay i.e the > time it takes to fetch the data from the server i have to show an > ajax activity indicator how can i do this. First off, if your DB query is taking long enough to require a progres

Re: Need to understand what this script does.

2014-08-11 Thread David Precious
On Mon, 11 Aug 2014 11:12:34 +0100 David Precious wrote: > On Sun, 10 Aug 2014 16:40:07 +0530 > Uday Vernekar wrote: > > > i din't understand what the whole script is doing.I need to > > understand first what this script is all about. > > Well, it cal

Re: Need to understand what this script does.

2014-08-11 Thread David Precious
On Sun, 10 Aug 2014 16:40:07 +0530 Uday Vernekar wrote: > i din't understand what the whole script is doing.I need to understand > first what this script is all about. Well, it calls some Oracle stored procedures, so without knowing what they do, we can only really tell you "it does something wi

Re: LWP/UserAgent fail authentication:

2014-07-31 Thread David Precious
'm not sure quite why it worked; GitHub's docs say that, if you're using a token, the username should be set as "$token:x-oauth-basic", and the password being unimportant; maybe this code worked against their older, now withdrawn v2 API. Anyway, I believe the lack of a p

Re: Suddenly this script is not working!

2014-07-30 Thread David Precious
On Wed, 30 Jul 2014 11:55:46 -0400 ESChamp wrote: > Robert Wohlfarth wrote on 7/30/2014 10:31 AM: > > On Wed, Jul 30, 2014 at 1:00 AM, ESChamp > > wrote: > > > > 0D 0A 3C 70 72 65 3E 0D 0A > > > > so no invisible characters. > > > > > Or maybe occurs on

Re: Can't Install Mojolicious on Shared Server

2014-07-30 Thread David Precious
On Tue, 29 Jul 2014 18:25:34 -0500 Mike Flannigan wrote: > I pay about $8 per month for a shared server hosting > at Hostgator. I recently asked Hostgator to install > Mojolicious on my account because I wanted to migrate > away from CGI. > > Hostgator tells me they can't install Mojolicious "on

Re: Suddenly this script is not working!

2014-07-29 Thread David Precious
On Mon, 28 Jul 2014 20:48:51 -0400 Shawn H Corey wrote: > > copy $htmfile, $copy; > > # always check for error > copy $htmfile, $copy or die "could not copy $htmlfile\n"; And even more helpfully, include in the message $! - which will contain the error message to show you what actually went w

Re: module installation error from cpan cli

2014-07-14 Thread David Precious
installing Test::More first should get you going. -- David Precious ("bigpresh") http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb.co.uk/linkedinwww.preshweb.co.uk/facebook www.preshweb.co.uk/cpanwww.preshweb.co.uk/github -- To unsubscribe, e-ma

Re: Apologetic request for simple one-off script

2014-07-13 Thread David Precious
mal shell redirection, e.g.: $ perl -lane 'say $F[-1]' in.txt > out.txt -- David Precious ("bigpresh") http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb.co.uk/linkedinwww.preshweb.co.uk/facebook www.preshweb.co.uk/cpanwww.preshweb.co.u

Re: script to match a valid email id

2014-07-11 Thread David Precious
On Fri, 11 Jul 2014 10:20:10 +0300 Yosef Levy wrote: > 2014-07-10 21:30 GMT+03:00 Sunita Pradhan > : > > > I want to write a script which will verify a valid email address . > > Could anybody give some ideas , how to write a pattern for this ? > \b[\w\.-]+@[\w\.-]+\.\w{2,4}\b > This was taken fr

Re: script to match a valid email id

2014-07-10 Thread David Precious
t an email address you want to accept. However, even that could trip you up. For example, "mickey mouse"@[127.0.0.1] is a valid email address :) -- David Precious ("bigpresh") http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb.co.uk/linked

Re: Teach script to look for modules in the same prefix when using MakeMaker

2014-06-16 Thread David Precious
On Sun, 15 Jun 2014 20:37:55 +0200 drupsspen wrote: > I'm building an application in Perl and is looking into using a build > system for it. So far I've looked at ExtUtils::MakeMaker. I have > divided my application like this: > > bin/foo > lib/Foo/Bar.pm > lib/Foo/Baz.pm > > The user runs the p

Re: Failed: PAUSE indexer report JUNIPER/Net-Netconf-0.01.zip

2014-06-02 Thread David Precious
ons to JUNIPER for that module, using: https://pause.perl.org/pause/authenquery?ACTION=share_perms (You can either give JUNIPER co-maint, or transfer primary maintainership.) -- David Precious ("bigpresh") http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb.co.uk/linkedin

Re: How to change username in Pause account

2014-05-29 Thread David Precious
On Thu, 29 May 2014 10:59:56 + Priyal Jain wrote: > Hello, > > I want to change my username in PAUSE, how should I do that. I don't think you can change your PAUSE username. After all, it would require all mirrors to know to rename your PAUSE dir, invalidate old links, etc. You can, howev

Re: close dbh in the subroutine

2014-05-08 Thread David Precious
On Thu, 08 May 2014 16:54:32 +0400 Jeff Pang wrote: > Hi, > > I created a $dbh object in the main body, and pass it to a > subroutine, then close the $dbh in the subroutine, does it  influence > the $dbh in the main? Yes. It's a reference to the same DBI object. -- To unsubscribe, e-mail:

Re: [irc Q] how to extract info to disk

2014-05-08 Thread David Precious
r channels by pattern. There's also irc.netsplit.de's IRC server/channel search engine: http://irc.netsplit.de/channels/?net=freenode -- David Precious ("bigpresh") http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb.co.uk/linkedinwww.preshweb.co.uk/f

Re: unsatisfied configure_requires in perl 5.12.3?

2014-04-22 Thread David Golden
l pay to the information it generates. David -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: time based test

2014-02-15 Thread David Precious
ng point would be awesome. Anything like that? > Time::Fake on CPAN appears to fit the bill: https://metacpan.org/pod/Time::Fake Install it, then e.g.: perl -MTime::Fake="+20y" yourscript.pl (See the docs for the various options etc.) -- David Precious ("bi

Re: mv Is Not Working the Same Way Under System as Under a Shell.

2014-01-30 Thread David Precious
ct you meant \"$directories/deleted_keys\". Oh, and make sure that the variables you're interpolating there aren't from an untrusted source :) Cheers Dave P -- David Precious ("bigpresh") http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb.co.uk/linkedin

Re: baby perl to get the right date

2014-01-28 Thread David Precious
>dmy('/'); It's a bit of a slow and heavyweight way to go about it if you're not already planning to use DateTime, though :) -- David Precious ("bigpresh") http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb.co.uk/linkedinwww.preshweb.co.uk/f

Re: Still Trying to Understand Perl Module Control Process

2014-01-14 Thread David Precious
You can provide the exact one you want, e.g.: cpanp -i NLNETLABS/Net-DNS-0.72.tar.gz (I don't use cpanplus, but I'd imagine that'll work; it does with cpan and cpanm) -- David Precious ("bigpresh") http://www.preshweb.co.uk/ www.preshweb.co.uk/twitter www.preshweb

Re: series of numbers to range notation

2014-01-07 Thread David Precious
On Tue, 7 Jan 2014 13:35:39 -0600 Hal Wigoda wrote: > On Tue, Jan 7, 2014 at 1:28 PM, Rajeev Prasad <.ne...@yahoo.com> > wrote: > > so i have this series of numbers: > > [...] > > there are two ranges in there: 349-396, 425-496 > > > > any hints as to how to write a perl code to represent the ser

  1   2   3   4   5   6   7   8   9   10   >