Re: How to reboot?

2024-01-13 Thread Lars Noodén via beginners
If you go the e-mail route for signalling, you can have Perl scripts on both ends using Crypt::OpenPGP to sign and/or encrypt the commands. Other options like XMPP were mentioned. Maybe one of the MQTT modules would be suitable. /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org

Re: Tool for develop in Perl

2023-10-22 Thread Lars Noodén via beginners
to burdensome desktop operating systems which when combined with inefficient, monolithic IDEs reduce overall productivity substantially while conveying an illusory /feeling/ of getting work done. /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail

Re: Code or tools

2023-08-17 Thread Lars Noodén
your colleagues will be reading it as well, for various reasons. So if you emphasize readability, you will help everyone out including your present and future self through the processes of both creation and maintenance. My 2 ¢ € /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.or

Re: Bash vs Perl

2023-07-14 Thread Lars Noodén
solve? /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Wide character in print at HTML::TreeBuilder::XPath function

2020-01-26 Thread Lars Noodén
On 1/26/20 9:58 AM, Lars Noodén wrote: > I've got a long script that has "use utf8;" near the top. The script > parses some HTML and then I run into trouble when printing the result as > shown below: > > use utf8; > use HTML::TreeBuilder::XPath; &

Wide character in print at HTML::TreeBuilder::XPath function

2020-01-25 Thread Lars Noodén
does not object to 99% of the material I've run it over daily for months but something, somewhere in a recent file is causing the wide character problem. It's also causing it to mangle the UTF-8 parts. How do I get the HTML::TreeBuilder::XPath module to use UTF-8 all the way through? /Lars

XML::Feed.pm perl on CentOS 7

2019-09-02 Thread Lars Noodén
CentOS 7 which I can add? /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Making use of XML::Feed->parse() more robust

2019-08-29 Thread Lars Noodén
nal handling code > https://www.perl.com/article/37/2013/8/18/Catch-and-Handle-Signals-in-Perl/ Is this something which should be handled differently in the module itself? /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h..

Making use of XML::Feed->parse() more robust

2019-08-28 Thread Lars Noodén
feeds and their formats or contents. So, are there instead any recommendations on how I can have perl trap the error or otherwise prevent malformed XML from bringing the whole program to a halt? Thanks, Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-m

Re: Perl invocations

2017-07-02 Thread Lars Noodén
7;#!/usr/bin/env perl' in a production environment though. But overall, it answers the questions I had. Regards Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Perl invocations

2017-07-02 Thread Lars Noodén
xample, is the 'use warnings;' pragma better than launching with -w? Same for launching perl via '#!/usr/bin/env perl' rather than '#!/usr/bin/perl' instead? What about a leading whitespace like with '#! /usr/bin/perl' instead of '#!/usr/bin/perl'

Re: [solved] Re: Module to extract patterns

2017-06-13 Thread Lars Noodén
w+ \s+ \? /x Regards Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

[solved] Re: Module to extract patterns

2017-06-13 Thread Lars Noodén
Ok. Thanks, Paul and David. I think I see how I can benefit from Text::Balanced but I now have my start with PPI and can list the expressions. Regards, Lars #!/usr/bin/perl use strict; use warnings; use PPI; use Data::Dumper; my $file = shift or ( die("Need a file name!\n") ); my

Module to extract patterns

2017-06-13 Thread Lars Noodén
? Regards, /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Fwd: Parsing web pages

2017-03-03 Thread Lars Noodén
ge. > > Thanks in advance. > Kavita > Once you have acquired the page using either WWW:Mechanize, LWP, or even just wget you can extract the table. The modules HTML::TreeBuilder and HTML::TreeBuilder::XPath do extraction rather easily if there is some consistent way to identify the

Net::ISC::DHCPd or Net::DHCP::Info

2017-01-30 Thread Lars Noodén
e the former references the latter in the manual page, it *might* be better but where would I look for empirical evidence of that guess? Regards, Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Processing binary data

2016-04-04 Thread Lars Noodén
trigger something to cause it being processed as unicode. Further it says that communication anything outside of the current Perl process is done in binary. So, if I am using read() to get a span of binary data, it should not only come in as binary but also stay as binary while I work with it, rig

Re: Processing binary data

2016-04-04 Thread Lars Noodén
On 04/03/2016 02:42 PM, Shlomi Fish wrote: > Hi Lars and all, > > On Thu, 31 Mar 2016 11:38:44 + > Duncan Ferguson wrote: > >> Lars, >> >> I believe 'unpack' is the right way to go, you just need to get the template >> right ('N' in

Processing binary data

2016-03-31 Thread Lars Noodén
and so on? Regards, Lars -- 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-14 Thread Lars Noodén
On 03/13/2016 02:14 PM, Peter Scott wrote: > On Sat, 12 Mar 2016 18:44:18 +0200, Lars Noodén wrote: [snip] >> What modification can prevent zombies yet allow multiple concurrent >> clients to attach? > > You need the WNOHANG option on your wait() to make it nonblocking

Re: Forking as another user

2016-03-12 Thread Lars Noodén
or waitpid() seem to be available to use to stop that, but if I insert either of them in the outer while loop, only one client can connect at a time. What modification can prevent zombies yet allow multiple concurrent clients to attach? Regards, Lars - while ( my $client = $serv

Forking as another user

2016-03-11 Thread Lars Noodén
If I have the code below to fork a child process, how would the right way be to fork as a different user? I gather that fork() itself does not support that, so some other method must be used. Regards, Lars - #!/usr/bin/perl use strict; use warnings; use English;# for $UID and such my

Re: Storing Output file.

2016-01-28 Thread Lars Noodén
Or a one-liner would work, if the replacement above really is what you want: perl -pi.orig -e 's/Debug/Error/g;' filter.txt The old file will be named filter.txt.orig and the new file with the substitutions will be filter.txt See the manual page for perlrun(1) for the details of the options e, i, and p. Regards, Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Bulk editing of JPEG metadata

2015-11-01 Thread Lars Noodén
I need to bulk edit the metadata in a large number of JPEG files. Which is the best CPAN module to help with that? Would it be Image::ExifTool ? Regards, Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http

Re: File::Sluprer (Re: Multi line file handling)

2015-10-20 Thread Lars Noodén
On 10/19/2015 07:40 PM, Kent Fredric wrote: > On 20 October 2015 at 03:55, Lars Noodén wrote: >> What is the main reason for the preference of File::Slurper over >> File::Slurp these days? > > > http://blogs.perl.org/users/leon_timmermans/2015/08/fileslurp-is-broke

File::Sluprer (Re: Multi line file handling)

2015-10-19 Thread Lars Noodén
rper over File::Slurp these days? Regards, /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

CRC16 from Digest::CRC

2015-06-05 Thread Lars Noodén
the C routine "yubikey_crc16" from "ykcrc.c" at https://github.com/Yubico/yubico-c/blob/master/ykcrc.c can generate such a checksum. How can I get the same result from the module Digest::CRC? Regards, Lars < CODE > #!/usr/bin/perl use strict

Re: Reading first 6 bytes of binary data

2015-06-02 Thread Lars Noodén
On 06/02/2015 01:18 PM, Shlomi Fish wrote: > Hi Lars, > > please reply to all recipients. > > On Tue, 02 Jun 2015 12:54:54 +0300 > Lars Noodén wrote: > >> I have a calculated variable $otp which is decrypted using AES key $key. >> If the variable was properly

Reading first 6 bytes of binary data

2015-06-02 Thread Lars Noodén
gards, Lars #!/usr/bin/perl use strict; use warnings; use Convert::ModHex qw(modhex2hex); use Crypt::Rijndael; my $input = qq(ujvrgjnigiibvrjctcflercebvcvhicbnhhheliclnfh); my $key= qq(83b396b8f996fa1be3dafdc3f0eefc21); my $userid = qq(aa6d0a6e8a65); my ( $publicid, $otp ) = ( $

Re: Match HTML ...... string over multiple

2014-11-18 Thread Lars Noodén
Parser::Simple, or XML::TokeParser. The latter would be only if the input is valid, well-formed XHTML. TokeParser can be used to find a table within a specific div. Regards, /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.or

Re: Apologetic request for simple one-off script

2014-07-17 Thread Lars Noodén
On 07/17/2014 05:16 PM, Uri Guttman wrote: > On 07/17/2014 09:02 AM, Lars Noodén wrote: >> Or maybe something like this in perl itself? >> >> perl -ne 'print @{[split(/\s+/,)]}[-1],qq(\n);' file > > much earlier in this thread there were one liner examp

Re: Apologetic request for simple one-off script

2014-07-17 Thread Lars Noodén
it(/\s+/,)]}[-1],qq(\n);' file Regards, /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Internet Search

2014-03-18 Thread Lars Noodén
On 03/18/2014 12:39 PM, Anant kumar wrote: > Dear Lars Nooden, > >I am finding difficulty in > installing the Program. Can you please take a look and advice me the > solution. > > > > Sincerely yours, > Anant Kumar >

Re: Internet Search

2014-03-15 Thread Lars Noodén
eas about how to approach the task. Regards, /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Suppressing Carp in a module

2014-01-01 Thread Lars Noodén
tch. Since the copyright notice in the module is 10 years old, where should a patch be sent? Regards, /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Suppressing Carp in a module

2013-12-28 Thread Lars Noodén
te normal in certain latitudes during some parts of the year and I'd like to quiet the error messages that result from using the module. regards, /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: HTML::TokeParser munging characters

2013-12-28 Thread Lars Noodén
nd up handling this with a regex. Thanks. Putting binmode at the beginning of the script fixed the output without needed regex. binmode(STDOUT, ":utf8"); Regards, /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

HTML::TokeParser munging characters

2013-12-28 Thread Lars Noodén
target URL is http://en.ilmatieteenlaitos.fi/weather/rovaniemi Regards, /Lars #!/usr/bin/perl use warnings; use strict; use HTML::TokeParser; use LWP::Simple; my $url = shift || '-'; my $weather = get( $url ); my $p = HTML::TokeParser->new(\$weather) or die "Ca

Re: DBD::Pg::st execute failed: execute called with an unbound placeholder

2013-12-11 Thread Lars Noodén
t you're running afoul of that... > > j. > Ok. Thanks. I'll look more closely there for the difference. I missed the restrictions on using placeholders. It may apply in more situations. Regards, /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For addition

DBD::Pg::st execute failed: execute called with an unbound placeholder

2013-12-11 Thread Lars Noodén
;); $sth->execute( $interval ); What mistake is there causing the error? I can use a similar line with a placeholder for a SELECT sql statement without error. Regards, /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: perlre(1) and substitution evaluations

2013-11-30 Thread Lars Noodén
the other modifiers are already there and they belong all together. The two s/// modifiers, /e and /r, should be at least named in that group at least as one-line summaries. Regards, /Lars -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

perlre(1) and substitution evaluations

2013-11-30 Thread Lars Noodén
rogramming Perl", 4th ed, pp 186, 254-255. Where should suggestions for corrections be sent? Could something like the text below be added? Regards, /Lars $ diff perlre.pod perlre.pod.orig 108,113d107 < =item e < X < < Treat the replacement portion as an interpreted expression. < E

Re: how to check null value

2008-04-22 Thread Lars Haugseth
tr eq " "){ print $str conatins > nothing\n";} Try this: if (!defined $str || $str eq "") { ... } Almost but not quite the same: if (!$str) { ... } Here the block will also be executed if the value of $str is 0. -- Lars Haugseth "If anyone disagrees with anyth

Re: Meta: please don't mail here if you have huge useless pointless disclaimers (was Re: SOH char)

2007-11-14 Thread Lars Haugseth
I'm using a news reader to post this reply. The messages can also be read by anyone with a web browser: http://www.nntp.perl.org/group/perl.beginners/ -- Lars Haugseth "If anyone disagrees with anything I say, I am quite prepared not only to retract it, but also to deny under oath that I ever said it." -Tom Lehrer -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: recognizing static or instance call

2006-01-07 Thread lars
Hi, > if ( ref $self ) { thanks to Todd and JupiterHost - that was quick and helpful! Lars -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>

recognizing static or instance call

2006-01-07 Thread lars
a bit dirty to me ... sub get_defaults { my $self = shift; $self = undef if ($self eq 'Example::Package'); if (defined($self)) } Is there a cleaner way to find out, if the sub was called as an object method or as a static sub? thanks, Lars -- To uns

file m-/a-/ctime comparison fails

2005-04-08 Thread lars
= readdir LOGDIR) { next if $_ =~ /^\./; $_ = "$logdir/$_"; if ((stat($_))[9] > (stat($root_auth_keys))[9]) { print "stat: ", (stat($_))[9];#debug print "stat: ", (stat($root_auth_keys))[9]; #debug

Finding mathing files, and getting the answer as a list.

2002-07-14 Thread Lars
Finding files that matches "*.jpg" recurse. And getting the answer as a list. Well that is not how to do it $files = system("find /mnt/flash -name \"*.jpg\" "); print "$files"; -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]