Re: Interpolation Problem

2016-07-17 Thread David Mertens
To second what Uri mentioned already, On Fri, Jul 15, 2016 at 11:42 PM, AC P wrote: > > > Argument "$command" isn't numeric in subtraction (-) at then it gives me > my directory. > > > This error message (I suspect it was a warning, can you check?) probably reported a line number. Could you p

Re: Perl regular expression for implementing infix expression parser?

2016-08-14 Thread David Mertens
Hello siegried, This is a fun question! In fact, v5.10 introduced "recursive subpatterns" into the regex lexicon, so using v5.10 or later, it is possible to implement (rather arcane) recursive descent regexes without resorting to eval-based tricks like what you have. But before diving in, a few q

Re: file type

2016-08-24 Thread David Mertens
I don't know if I add much to the conversation by simply referring you to Stack Overflow, but I've found that it's a decent repository of information for this sort of question. This question has been asked and answered before

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 of ways to wri

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

2017-07-06 Thread David Mertens
On Thu, Jul 6, 2017 at 9:12 PM, wrote: > I find it a little surprising that use of the '!' operator is all that's > needed to add the stringification stuff: > > ... > > If the '!' operator didn't do that, then I believe the OP would be seeing > precisely what he expects. > > So ... why should the

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

2017-07-07 Thread David Mertens
On Thu, Jul 6, 2017 at 11:05 PM, wrote: > Perl is highly unusual in that the operator, not the operand, dictates the >> context. >> > > Good point - and one that I hadn't got around to noticing. > > Therefore, the '!' operator has to be set up to either: > a) operate always in numeric context; >

Re: Filehandle within foreach loop

2017-07-16 Thread David Mertens
Even more readable: FILE: foreach my $file ( @files ) } ... last FILE if (some_condition); ... } Also note that lexical filehandles close when they go out of scope, except for the most recently "stat"ed file. Perl holds a reference to "the most recently stat-ed filehandle" in "the solitary

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: 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. David On Mon

Re: "Information station" using Perl and Raspberry Pi

2017-07-25 Thread David Mertens
Hello Frank, I think I can speak with some minor authority on this. I am a BeagleBone Black guy, not a RPi guy, but in this situation I think my knowledge of one is enough to inform the other. The RPi (and BeagleBone Black) run full Linux OSes running on ARM. Perl runs just fine on these; web ser

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: 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, 2022, 10:14 AM Wi

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

2022-02-04 Thread David Mertens
ttf', >> pointsize=>40,fill=>'green',text=>$text); >> >> # Perhaps you want to extract all the pixel intensities from an image and >> write them to STDOUT >> @pixels = $image->GetPixels(map=>'I', >> height=>$height,width=>$w

Re: Please help: perl run out of memory

2022-04-17 Thread David Mertens
I see nothing glaringly inefficient in the Perl. This would be fine on your system if you were dealing with 1 million items, but you could easily be pushing up against your system's limits with the generic data structures that Perl uses, especially since Perl is probably using 64-bit floats and int