From gatorreina at gmail.com Mon Jun 25 08:21:29 2018 From: gatorreina at gmail.com (Richard Reina) Date: Mon, 25 Jun 2018 10:21:29 -0500 Subject: [Chicago-talk] perl Term::ANSIColor not working on Raspberry Pi Console Message-ID: use Term::ANSIColor;print color("blink bold red"), "TEST\n";print color("reset"); The above code has worked for eons on whatever linux console I have used it on. However, I when I try it on a Raspberry Pi console (not Xwindows) running Raspbian Stretch it simply colors the text red but does not blink. Anyone have any ideas as to how I can get this to work? I am willing to install a different linux console/frame buffer if such a thing is possible and needed. Any help would be greatly appreciated. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From jason at froebe.net Mon Jun 25 11:48:19 2018 From: jason at froebe.net (Jason Froebe) Date: Mon, 25 Jun 2018 14:48:19 -0400 Subject: [Chicago-talk] perl Term::ANSIColor not working on Raspberry Pi Console In-Reply-To: References: Message-ID: Which terminal is set? take a look at https://unix.stackexchange.com/questions/269809/blink-codeescape-code-has-been-removed On 6/25/2018 11:21 AM, Richard Reina wrote: > |useTerm::ANSIColor;printcolor("blink bold > red"),"TEST\n";printcolor("reset");| > > The above code has worked for eons on whatever linux console I have > used it on. However, I when I try it on a Raspberry Pi console (not > Xwindows) running Raspbian Stretch it simply colors the text red but > does not blink. Anyone have any ideas as to how I can get this to > work? I am willing to install a different linux console/frame buffer > if such a thing is possible and needed. > > Any help would be greatly appreciated. > > Thanks > > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk -------------- next part -------------- An HTML attachment was scrubbed... URL: From gatorreina at gmail.com Tue Jun 26 14:13:35 2018 From: gatorreina at gmail.com (Richard Reina) Date: Tue, 26 Jun 2018 16:13:35 -0500 Subject: [Chicago-talk] perl Term::ANSIColor not working on Raspberry Pi Console In-Reply-To: References: Message-ID: Hi Jason, Thanks for the reply with the link. I am playing around with termcap info. No luck so far but still at it. Thanks again 2018-06-25 13:48 GMT-05:00 Jason Froebe : > Which terminal is set? > > take a look at > https://unix.stackexchange.com/questions/269809/blink- > codeescape-code-has-been-removed > > > On 6/25/2018 11:21 AM, Richard Reina wrote: > > use Term::ANSIColor;print color("blink bold red"), "TEST\n";print color("reset"); > > The above code has worked for eons on whatever linux console I have used > it on. However, I when I try it on a Raspberry Pi console (not Xwindows) > running Raspbian Stretch it simply colors the text red but does not blink. > Anyone have any ideas as to how I can get this to work? I am willing to > install a different linux console/frame buffer if such a thing is possible > and needed. > > Any help would be greatly appreciated. > > Thanks > > > _______________________________________________ > Chicago-talk mailing listChicago-talk at pm.orghttp://mail.pm.org/mailman/listinfo/chicago-talk > > > > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From JJacobus at PonyX.com Thu Jun 28 10:21:25 2018 From: JJacobus at PonyX.com (Jim Jacobus) Date: Thu, 28 Jun 2018 12:21:25 -0500 Subject: [Chicago-talk] Could someone explain this Message-ID: <20180628174735.4B69411F9F2@xx1.develooper.com> Hi, I'm embarrassed to ask this, but I'd like to understand this piece of code. I want to find out how many times a certain substring appears in the string ($block). $block is a very long string that is part of an XML file. I found this when rooting around for an example: my $count = () = ( $block =~ m/\/g); It does work. $count gives me the number of times the substring appears in $block. However, I don't undstand how this works. What is "= () =" mean. Jim From joel.limardo at forwardphase.com Thu Jun 28 10:56:09 2018 From: joel.limardo at forwardphase.com (Joel Limardo) Date: Thu, 28 Jun 2018 12:56:09 -0500 Subject: [Chicago-talk] Could someone explain this In-Reply-To: <20180628174735.4B69411F9F2@xx1.develooper.com> References: <20180628174735.4B69411F9F2@xx1.develooper.com> Message-ID: The match with the /g operator says find all so and that is in parentheses so my guess is that produces a list containing all of the matches. That gets assigned to an anonymous array which in turn is being assigned to a scalar which, as you should know from rudimentary Perl lessons, results in the number of elements in the array to be returned. When curious to know what long, somewhat tricky Perl lines of code are doing you can just split them up into mulfiple instructions and then use the debugger to figure out what is being passed around. On Jun 28, 2018 12:47 PM, "Jim Jacobus" wrote: > Hi, > I'm embarrassed to ask this, but I'd like to understand this piece of code. > > I want to find out how many times a certain substring appears in the > string ($block). $block is a very long string that is part of an XML file. > I found this when rooting around for an example: > > my $count = () = ( $block =~ m/\/g); > > It does work. $count gives me the number of times the substring appears in > $block. > However, I don't undstand how this works. What is "= () =" mean. > > Jim > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk > -------------- next part -------------- An HTML attachment was scrubbed... URL: From andy at petdance.com Thu Jun 28 11:01:34 2018 From: andy at petdance.com (Andy Lester) Date: Thu, 28 Jun 2018 13:01:34 -0500 Subject: [Chicago-talk] Could someone explain this In-Reply-To: References: <20180628174735.4B69411F9F2@xx1.develooper.com> Message-ID: <3354449F-E0BD-42E0-A565-3A33DA1A4B88@petdance.com> For more of these sort of ?secret" operators: http://www.catonmat.net/blog/secret-perl-operators/ https://metacpan.org/pod/distribution/perlsecret/lib/perlsecret.pod -------------- next part -------------- An HTML attachment was scrubbed... URL: From shlomif at shlomifish.org Thu Jun 28 11:00:32 2018 From: shlomif at shlomifish.org (Shlomi Fish) Date: Thu, 28 Jun 2018 21:00:32 +0300 Subject: [Chicago-talk] Could someone explain this In-Reply-To: <20180628174735.4B69411F9F2@xx1.develooper.com> References: <20180628174735.4B69411F9F2@xx1.develooper.com> Message-ID: <20180628210032.3b812b49@telaviv1.shlomifish.org> Hi Jim, On Thu, 28 Jun 2018 12:21:25 -0500 Jim Jacobus wrote: > Hi, > I'm embarrassed to ask this, but I'd like to understand this piece of code. > > I want to find out how many times a certain substring appears in the > string ($block). $block is a very long string that is part of an XML file. > I found this when rooting around for an example: > > my $count = () = ( $block =~ m/\/g); > > It does work. $count gives me the number of times the substring > appears in $block. > However, I don't undstand how this works. What is "= () =" mean. > see https://metacpan.org/pod/distribution/perlsecret/lib/perlsecret.pod#Goatse . Also note regarding XML that http://perl-begin.org/uses/text-parsing/ - do not use regexes for that. > Jim > _______________________________________________ > Chicago-talk mailing list > Chicago-talk at pm.org > http://mail.pm.org/mailman/listinfo/chicago-talk -- ----------------------------------------------------------------- Shlomi Fish http://www.shlomifish.org/ Parody of "The Fountainhead" - http://shlom.in/towtf Sisko: Q: would it be OK if my crew brought along their phasers with them? Q: Of course. They can also bring some photon torpedoes if they wish. None of them will work, but I don?t mind them taking them. Please reply to list if it's a mailing list post - http://shlom.in/reply .