Hi William,
Here are my two cents after nearly 30 years of writing code in many
different languages.
Writing in any functional language is exactly the same as in every other
functional language. The easiest way to learn and improve is by learning to
break down your problem into manageable steps.
On Sat, 2024-01-13 at 22:53 +, Tim Lewis via beginners wrote:
> To send email to text for the main carriers in the US:
> AT&T
> Compose a new email and enter the recipient's 10-digit wireless number,
> followed by @txt.att.net.
> T-Mobile
> Write a new email message.
> Enter the recipients T-M
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
On Sat, 2024-01-13 at 17:09 +, Tim Lewis via beginners wrote:
> You bring an excellent point about the ability to spoof the email address.
> In my case the email that for the server is not made public, but that is a
> vulnerability. I will have to read up on pwgen. That sounds like a good
>
On Sat, 2024-01-13 at 08:49 -0600, twlewis via beginners wrote:
> Hi hw, I had a similar situation in which I travelled. I wanted to
> lock down the ufw firewall but be able to allow certain IP addresses
> based on the hotel IP or my cell service IP. To that I developed
> Perl that would check my
On Sat, 2024-01-13 at 10:24 +0530, Andinus via beginners wrote:
> hw @ 2024-01-12 18:49 +01:
>
> > Thanks, I thought about sudo and figured it needs a password being
> > entered. If that works without, I'll start programming and test if
> > something else gets in the way :)
>
> You can configure
Hi hw,
I had a similar situation in which I travelled. I wanted to lock down the ufw
firewall but be able to allow certain IP addresses based on the hotel IP or my
cell service IP. To that I developed Perl that would check my smtp account.
The script is controlled through a cron job that run
hw @ 2024-01-12 18:49 +01:
> Thanks, I thought about sudo and figured it needs a password being
> entered. If that works without, I'll start programming and test if
> something else gets in the way :)
You can configure sudo to not ask for a password.
--
To unsubscribe, e-mail: beginners-unsubs
On Fri, 2024-01-12 at 21:39 +0530, Andinus via beginners wrote:
> hw @ 2024-01-12 14:16 +01:
>
> > But how can I reboot/restart the computer from the xmpp client? I
> > don't want the xmpp client to run as root all the time. I would use
> > something like
> >
> >
> > system('shutdown', '-r', '
hw @ 2024-01-12 14:16 +01:
> But how can I reboot/restart the computer from the xmpp client? I
> don't want the xmpp client to run as root all the time. I would use
> something like
>
>
> system('shutdown', '-r', 'now');
>
>
> in the xmpp client, and that does require root privileges. To make
>
On Mon, 2022-08-01 at 14:50 -0600, William Torrez Corea wrote:
> On Mon, Aug 1, 2022 at 8:16 AM Christian Walde
>
> wrote:
>
> > On Sat, 23 Jul 2022 21:03:18 +0200, William Torrez Corea <
> > willitc9...@gmail.com> wrote:
> >
> > My goal: I want to create
> >
> >
> > Being that you barely know
I agree. Roadmap is good. I even gave him a
starting roadmap, but I think he is just looking
for the answer. Which means he is going to be
disappointed for sure.
Mike
On 8/2/22 03:41, Ruprecht Helms (privat) wrote:
for bigger developing-project the best thing is a roadmap, because
For PDF related development one valuable resource is
https://opensource.adobe.com/dc-acrobat-sdk-docs/pdfstandards/pdfreference1.7old.pdf
I don’t have any experience in this but investigated many years ago to automate
digital publication. Maybe it will help. I’m sure Perl can be applied but as
First you need the roadmap of what you want to do.
The other is to read one or both of the mentioned book below. Or book
about beginning perl from the Oreily-Distributor. Maybe the book
"Effective Perl Programming" from
Joseph N. Hall can be an additional option.
As mentioned in another mail f
On Tue, Aug 2, 2022 at 3:16 AM Christian Walde
wrote:
> On Tue, 02 Aug 2022 10:41:36 +0200, Ruprecht Helms (privat) <
> rhe...@rheynmail.de> wrote:
> > Am 02.08.22 um 10:07 schrieb Christian Walde:
> >> On Mon, 01 Aug 2022 22:50:21 +0200, William Torrez Corea
> >> wrote:
> >>
> >>> On Mon, Aug 1
Hi everybody,
Am 02.08.22 um 11:16 schrieb Christian Walde:
On Tue, 02 Aug 2022 10:41:36 +0200, Ruprecht Helms (privat)
wrote:
Am 02.08.22 um 10:07 schrieb Christian Walde:
What you're describing is how to make a roadmap for the implementation
of a specific program.
William asked about l
On Tue, 02 Aug 2022 10:41:36 +0200, Ruprecht Helms (privat)
wrote:
Am 02.08.22 um 10:07 schrieb Christian Walde:
On Mon, 01 Aug 2022 22:50:21 +0200, William Torrez Corea
wrote:
On Mon, Aug 1, 2022 at 8:16 AM Christian Walde
wrote:
On Sat, 23 Jul 2022 21:03:18 +0200, William Torrez Corea
for bigger developing-project the best thing is a roadmap, because you
have to plan the steps
what the thing should do.
Start with a sheet of paper and a pencil and after that you can decide
what programminglanguage
to use and which module you want to start first.
Regards,
Ruprecht
A
On Mon, 01 Aug 2022 22:50:21 +0200, William Torrez Corea
wrote:
On Mon, Aug 1, 2022 at 8:16 AM Christian Walde
wrote:
On Sat, 23 Jul 2022 21:03:18 +0200, William Torrez Corea <
willitc9...@gmail.com> wrote:
My goal: I want to create
you should start [...] reading Modern Perl and Ovid's
Hi William!
On Mon, 1 Aug 2022 14:50:21 -0600
William Torrez Corea wrote:
> On Mon, Aug 1, 2022 at 8:16 AM Christian Walde
> wrote:
>
> > On Sat, 23 Jul 2022 21:03:18 +0200, William Torrez Corea <
> > willitc9...@gmail.com> wrote:
> >
> > My goal: I want to create
> >
> >
> > Being that yo
On Mon, Aug 1, 2022 at 8:16 AM Christian Walde
wrote:
> On Sat, 23 Jul 2022 21:03:18 +0200, William Torrez Corea <
> willitc9...@gmail.com> wrote:
>
> My goal: I want to create
>
>
> Being that you barely know anything about Perl, you should start with
> learning how Perl works by reading Modern
On Sat, 23 Jul 2022 21:03:18 +0200, William Torrez Corea
wrote:
My goal: I want to create
Being that you barely know anything about Perl, you should start with learning
how Perl works by reading Modern Perl and Ovid's Beginning Perl.
Right now you're doing the moral equivalent of asking ho
Hi,
I know eclipse as a developingtool that is normaly used for
Java-development.
But this tool also have plugins for developing in PHP, for
Android-Programming
and maybe for development in perl or in python.
Regards,
Ruprecht
Am 01.08.22 um 13:23 schrieb hw:
I have installed eclipse on my
On Sun, 2022-07-31 at 21:06 -0600, William Torrez Corea wrote:
> On Sun, Jul 31, 2022 at 8:55 PM hw wrote:
>
> > On Sun, 2022-07-31 at 18:04 -0600, William Torrez Corea wrote:
> > > On Sun, Jul 31, 2022 at 5:57 PM Marco Shaw
> > > wrote:
> > >
> > > > Being a novice, you have to realize there a
On Sun, Jul 31, 2022 at 8:55 PM hw wrote:
> On Sun, 2022-07-31 at 18:04 -0600, William Torrez Corea wrote:
> > On Sun, Jul 31, 2022 at 5:57 PM Marco Shaw
> > wrote:
> >
> > > Being a novice, you have to realize there are certain limitations
> > > to
> > > things. In other words, Perl maybe can'
On Sun, 2022-07-31 at 18:04 -0600, William Torrez Corea wrote:
> On Sun, Jul 31, 2022 at 5:57 PM Marco Shaw
> wrote:
>
> > Being a novice, you have to realize there are certain limitations
> > to
> > things. In other words, Perl maybe can't do EVERYTHING you want it
> > to.
> >
>
> Very clear,
On Sun, Jul 31, 2022 at 5:57 PM Marco Shaw wrote:
> Being a novice, you have to realize there are certain limitations to
> things. In other words, Perl maybe can't do EVERYTHING you want it to.
>
Very clear, so, would I use another language of programming to make the
rest of the program?.
--
On Sun, 2022-07-31 at 17:34 -0600, William Torrez Corea wrote:
> Where can I start?
>
> I am Script kiddie, I have zero knowledge about Perl. I need a
> stimulus.
>
> For example: I am executing perl examples.
>
> But the project i don't know how to start.
>
> https://learn.perl.org/
Always us
I didn't try to read and fully absorb what you've been saying. I see
mention of PDFs...
So if you're trying to work with PDF files, the first thing you can do is
Google "Perl PDF extract information". If that comes up empty, or points
you to external tools like an external module or command to h
Where can I start?
I am Script kiddie, I have zero knowledge about Perl. I need a stimulus.
For example: I am executing perl examples.
But the project i don't know how to start.
https://learn.perl.org/
Well, what can you do with your bare hands? Build tools so you can do
stuff, starting with using stones and the like for tools?
On Fri, 2022-07-29 at 13:26 -0600, William Torrez Corea wrote:
> On Fri, Jul 29, 2022 at 11:38 AM hw wrote:
>
> > On Sat, 2022-07-23 at 13:03 -0600, William Torrez
On Fri, Jul 29, 2022 at 11:38 AM hw wrote:
> On Sat, 2022-07-23 at 13:03 -0600, William Torrez Corea wrote:
> > My goal: I want to create something similar to the phone guide. In
> > this
> > page exist a great number of documents in format pdf. So, I want to
> > unite
> > the different documents
On Sat, 2022-07-23 at 13:03 -0600, William Torrez Corea wrote:
> My goal: I want to create something similar to the phone guide. In
> this
> page exist a great number of documents in format pdf. So, I want to
> unite
> the different documents and can filter for name, last name, location.
> If I
> m
My goal: I want to create something similar to the phone guide. In this
page exist a great number of documents in format pdf. So, I want to unite
the different documents and can filter for name, last name, location. If I
make this manually I have to open each document, download the document and
sea
I'm going to be traveling, so will not be able to help much
in the next 2 days.
That is a PDF file you supplied. Is it fair to say you want to
be able to search for all the names listed in a text file and be
able to print out which file contains which name. And in some
cases the name will not
The url of the page:
https://www.pgr.gob.ni/PDF/2021/GACETA/GACETA_17_08_2021.pdf
On 7/20/22, William Torrez Corea wrote:
> Exist a page where you put info about the person but if you want to search
> a name you must search this manually. So, I want to automate this process
> with perl.
> --
>
>
Hi Jeffrey,
On Tue, 28 Jan 2020 01:02:46 -0500
Jeffrey Walton wrote:
> Hi Everyone,
>
> I regression test on old machines. The older machines need an updated
> Git, SSH and Wget. To update Git, SSH and Wget I need to build a lot
> of dependent software. Perl is one of them.
>
> On Fedora 1 whi
On Tue, Jan 28, 2020 at 3:02 AM Shlomi Fish wrote:
>
> ...
> >
> > On Fedora 1 while trying to build Perl 5.10.1:
> >
>
> perl 5.10.1 is very old and no longer maintained (see what I wrote at
> https://github.com/shlomif/supporting-older-perl5-releases ), but OTOH so is
> Fedora 1.
Yeah, this is
Hi,
On Thu, 8 Aug 2019 08:21:24 +0530
Chankey Pathak wrote:
> You can create a signal handler for die and handle the exception in there.
> Refer https://users.cs.cf.ac.uk/Dave.Marshall/PERL/node116.html
>
Also see block eval - https://perldoc.pl/functions/eval - or one of its
wrappers like htt
Hi all,
Try::Tiny seems work fine to me. thanks.
在 2019/8/8 14:19, Shlomi Fish 写道:
You can create a signal handler for die and handle the exception in there.
Referhttps://users.cs.cf.ac.uk/Dave.Marshall/PERL/node116.html
Also see block eval -https://perldoc.pl/functions/eval - or one of its
Hi Eliza,
For a simpler approach without "action at a distance" wrap the call which
might trigger the die in an eval. For example:
https://gist.github.com/andrewsolomon/e43522deebd71c6539ed12026f82788b
Once you feel comfortable with this you can explore various libraries for
handling this in a m
You can create a signal handler for die and handle the exception in there.
Refer https://users.cs.cf.ac.uk/Dave.Marshall/PERL/node116.html
On Thu, 8 Aug, 2019, 8:15 AM Eliza, wrote:
> Hello,
>
> I use such a module from other people.
> In this module there is the "die" statement, for example,
>
On 12/26/18 7:31 AM, Mike Martin wrote:
Any ideas how to test for the existance of a file, when the file name
contains extended ascii characters
For example if the file contains emdash (U-2014) file -e always
returns false
-e should not be looking at the filename directly. it checks if th
I created a file whose name is just an emdash in bash with
$ printf '\xe2\x80\x94'
and this seems to work here (linux):
my $fname = "\xe2\x80\x94";
if (-e "$fname") {
print "exists\n"
}
On 2018-12-26 12:31:24, Mike Martin wrote:
> Any ideas how to test for the existance of a file, when the
Dear All,
This is a Perl place for Python there are many places.
BR,
Armando
El 25/10/18 a las 17:17, Chris Fedde escribió:
why post a python solution here?
On Thu, Oct 25, 2018 at 8:58 AM Asad
mailto:asad.hasan2...@gmail.com>> wrote:
Hi ,
Yes i have the code :
import re
import datetime
fr
why post a python solution here?
On Thu, Oct 25, 2018 at 8:58 AM Asad wrote:
> Hi ,
>
> Yes i have the code :
>
> import re
> import datetime
> from datetime import timedelta
>
> Header = "*"
>
> f3 = open ( r"D:\QI\logA.txt", 'r' )
> string =
Hi ,
Yes i have the code :
import re
import datetime
from datetime import timedelta
Header = "*"
f3 = open ( r"D:\QI\logA.txt", 'r' )
string = f3.read ()
regex = re.compile ( "\n" )
st = regex.sub ( " ", string )
st1 = st.split ( " " )
if re.
(Please reply to the list.)
If you have written code that extracts the date and time from the ‘LOG flle
opened’ lines in the log file, then please show us your code. You seem to be
asking other people to write your program for you. You will get better help if
you appear to be making an effort t
> On Oct 24, 2018, at 9:54 PM, Asad wrote:
>
> Thank all now I am able to progress :
>
> file1 i am able to extract the start and end timestamp
> file 2 i am able to extract the timestamp
>
> used the following
> my $t1 = Time::Piece->strptime('Feb 23 01:10:28 2018', '%b %d %H:%M:%S %Y'
Thank all now I am able to progress :
file1 i am able to extract the start and end timestamp
file 2 i am able to extract the timestamp
used the following
my $t1 = Time::Piece->strptime('Feb 23 01:10:28 2018', '%b %d %H:%M:%S
%Y'); coming from file1
my $t2 = Time::Piece->strptime('02/23/18 01:
Someone brought to my attention that I had failed to define a
couple of variables in the sample code I posted and they were
quite right. I don't mind sharing my work but the entire
application I wrote to get a brief local weather summary is
242 lines and I was trying to stay close to the topic, he
===> I am using the following regex :
([A-Z][a-z]{2}\s)([0-9]{2}\s[0-2][0-9](:[0-5][0-9]){2}\s[0-9]{4})
> Both are working as expected I would like to know if these are good regex
or it can be better , please suggest .
Concurring with the others, your setting yourself up for trouble with the
RE
I cannot emphasize enough how fragile the perhaps obvious regex based
comparisons of timestamps can be. I second the approach demonstrated by
Илья Рассадин above. There are subtle and difficult to debug problems
buried in timestamps. Not least of which is locale ambiguity,
discontinuities like da
Hi,
> Thank you all for the reply it is working for me .
>
> 1) for 02/23/18 01:10:33 ==> I am using the following regex
> \d\d/\d\d/\d\d\s[012][0-9]:[0-5][0-9]:[0-5][0-9]
> 2) Feb 23 01:10:28 2018
> > I am using the following regex :
> ([A-Z][a-z]{2}\s)([0-9]{2}\s[0-2][0-9](:[0-5][0-9]){2}\
Thank you all for the reply it is working for me .
1) for 02/23/18 01:10:33 ==> I am using the following regex
\d\d/\d\d/\d\d\s[012][0-9]:[0-5][0-9]:[0-5][0-9]
2) Feb 23 01:10:28 2018
> I am using the following regex :
([A-Z][a-z]{2}\s)([0-9]{2}\s[0-2][0-9](:[0-5][0-9]){2}\s[0-9]{4})
> first hurdle is how do I extract this Feb 23 01:10:28 2018 from file1
which regex
Look at perldoc -f stat
($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size,
$atime,$mtime,$ctime,$blksize,$blocks)
= stat($filename);
Not all fi
Hi All ,
first hurdle is how do I extract this Feb 23 01:10:28 2018 from
file1 which regex can I use ?
convert it into epoch
then
regex for 02/23/18 01:10:33 is required ?
convert into epoch
So if you can suggest the correct regex for both t
use Time::Piece;
my $t1 = Time::Piece->strptime('Feb 23 01:10:28 2018', '%b %d %H:%M:%S %Y');
my $t2 = Time::Piece->strptime('02/23/18 01:10:33', '%m/%d/%y %H:%M:%S');
if ($t1 > $t2) { ... }
On 23/10/2018 09:17, Asad wrote:
Hi All ,
first hurdle is how do I extract this Feb 23 01:10:
/wiki/FAQ
https://metacpan.org/pod/DateTime::Format::Strptime#$strptime-%3Eparse_datetime($string)
The parsing section on https://perlmaven.com/datetime
Duncs
From: Asad [mailto:asad.hasan2...@gmail.com]
Sent: 23 October 2018 07:18
To: Jim Gibson
Cc: beginners@perl.org
Subject: Re: How to compare
Hi All ,
first hurdle is how do I extract this Feb 23 01:10:28 2018 from
file1 which regex can I use ?
convert it into epoch
then
regex for 02/23/18 01:10:33 is required ?
convert into epoch
So if you can suggest the correct regex for both t
Thanks, I will do that. It was for perl .
On Tue, Oct 23, 2018 at 10:42 AM Jim Gibson wrote:
> On Oct 22, 2018, at 9:12 PM, Asad wrote:
> >
> > file1 :
> > Patching tool version 12.1.0.2.0 Production on Fri Feb 23 01:10:28 2018
> >
> > Bootstrapping registry and package to current versions...do
On Oct 22, 2018, at 9:12 PM, Asad wrote:
>
> file1 :
> Patching tool version 12.1.0.2.0 Production on Fri Feb 23 01:10:28 2018
>
> Bootstrapping registry and package to current versions...done
> statement ERR-2001: table is corrupt check for cause
>
> could not determine the current status.
>
I have a utility I use to wrap logging lines and make them easier to look
at. It has different features than you want but down in the core might be
a few clues of some use.
Without options it generates output like the below:
$ wrap /var/log/mail.log
Aug 23 10:39:52 crf postfix/pickup[12668]:
rea...@newsguy.com (Harry Putnam) writes:
> So trying to simplify things I'm running the script against 3 log
> lines produced by sendmail. The 3 lines below are in a file named
> `mail-loglines'.
Instead of simplifying I made a mess of things... I left this line at
the bottom of the script:
__
jimsgib...@gmail.com (Jim Gibson) writes:
> There is an error in what I posted (sorry). The input is read into
> the $line variable, but your regular expression is implicitly
> testing the default variable $_. The loop should be:
>
>
> while ( my $line = <> ) {
> if ( $line =~ /$rgx/ ) {
>
> On Aug 18, 2017, at 6:05 AM, Harry Putnam wrote:
>
> jimsgib...@gmail.com (Jim Gibson) writes:
>>>
>
> A second attempt trying to use your last example as inspiration
> follows:
>
> ---8< snip -8< snip --
>
> use strict;
> use warnings;
> use Text::Wrap;
>
>
jimsgib...@gmail.com (Jim Gibson) writes:
>> On Aug 13, 2017, at 6:02 PM, Harry Putnam wrote:
>>
>> My aim:
>>
>> Run certain kinds of log file lines thru a perl script that will:
>>
>> 1) Identify each line by regex that finds pattern at start of line
>> 2) When such a line is found, print ne
jimsgib...@gmail.com (Jim Gibson) writes:
>> On Aug 13, 2017, at 6:02 PM, Harry Putnam wrote:
>>
>> My aim:
>>
[...]
>> my @text;
>>
>> while (<>) {
>> if (/$rgx/) {
>> print "\n";
>> print wrap(",", @text);
>> }
>> }
>>
>> It wasn't at all clear from perldoc Text::Wrap how @text is sup
> On Aug 13, 2017, at 6:02 PM, Harry Putnam wrote:
>
> My aim:
>
> Run certain kinds of log file lines thru a perl script that will:
>
> 1) Identify each line by regex that finds pattern at start of line
> 2) When such a line is found, print newline first then
> 3) wrap any lines longer than s
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 expression, that can match an
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:
[davidp@cloudburst
Shekar writes:
> Depending upon how vendor implemented SNMP part for their device, other
> than standard OID's such as sysUptime , will have custom MIB files.
> You should try visiting their website for downloading required MIB file for
> your switch.
> Then import them with -m or put it under sn
mailing lists writes:
> are you sure?
>
> # emerge -s expect
>
> [ Results for search key : expect ]
> Searching...
>
> [...]
> * dev-perl/Expect
> Latest version available:
Depending upon how vendor implemented SNMP part for their device, other
than standard OID's such as sysUptime , will have custom MIB files.
You should try visiting their website for downloading required MIB file for
your switch.
Then import them with -m or put it under snmp path to get its OID's wo
lee writes:
> Shekar writes:
>
>> +1 for SNMP, or if Net::SSH::Perl didn't help, can you try expect module?
>
> Thanks! 'Expect' isn't available as Gentoo package, so I skipped it.
>
> SNMP is probably better, so I need to learn about that first and see if
> I can use it. I guess it's time to
Shekar writes:
> +1 for SNMP, or if Net::SSH::Perl didn't help, can you try expect module?
Thanks! 'Expect' isn't available as Gentoo package, so I skipped it.
SNMP is probably better, so I need to learn about that first and see if
I can use it. I guess it's time to learn about SNMP anyway :
+1 for SNMP, or if Net::SSH::Perl didn't help, can you try expect module?
Cheers,
Shekar
On Wed, Apr 19, 2017 at 1:38 PM, lee wrote:
> Duncan Ferguson writes:
>
> > If the temperature is available on your switch, can you not enable SNMP
> on it and read the specific OID to get the info? Far
Duncan Ferguson writes:
> If the temperature is available on your switch, can you not enable SNMP on it
> and read the specific OID to get the info? Far far easier than trying to
> keep an ssh connection open, I think.
>
> I guess this does depend on the switch type and whether the info is ava
SSC_perl writes:
>> On Apr 18, 2017, at 6:19 PM, lee wrote:
>>
>> The purpose is to get room temperature readings
>
> Hey Lee,
>
> I don’t have a solution for you, but I have an idea that might
> help. Have you tried the Misterhouse mailing list? It’s a Perl
> script that handles sensor
If the temperature is available on your switch, can you not enable SNMP on it
and read the specific OID to get the info? Far far easier than trying to keep
an ssh connection open, I think.
I guess this does depend on the switch type and whether the info is available
on the device via SNMP, tho
Hm, IIUC can't the remote script sleep-loop and send output
back asynchronously. (More reseach needed on async piece)..
$ssh->system('/path/to/remote_script arg, arg,...');
#!/bin/...
# remote_script
for (...); do get_temp_probe(); . ; sleep 300; done
On Tue, Apr 18, 2017 at 6:19
> On Apr 18, 2017, at 6:19 PM, lee wrote:
>
> The purpose is to get room temperature readings
Hey Lee,
I don’t have a solution for you, but I have an idea that might help.
Have you tried the Misterhouse mailing list? It’s a Perl script that handles
sensors like that so someone there
Thanks for your reply.
First of all, my example was not about performance, but was about an
idea. So you are correct about qw and sort. I'm sorry if someone saw
this example and decide to use it without reading perldoc and
understanding what we do.
We need to reverse sort because when we st
On Wed, 12 Apr 2017 19:34:22 -0400
Uri Guttman wrote:
> it is so odd to be filtering an array by the indexes. i smell an XY
> problem here. i wonder what the real goal is vs how to solve it this
> way.
>
> thanx,
>
> uri
I was thinking that too.
--
Don't stop where the ink does.
S
On 04/12/2017 07:29 PM, Shawn H Corey wrote:
On Wed, 12 Apr 2017 18:16:56 -0400
Uri Guttman wrote:
It's not about saving time. It's about removing a bug. In the code
below, notice that there are two different outputs depending on the
order that splice is applied. It's only by using descending i
On Wed, 12 Apr 2017 18:16:56 -0400
Uri Guttman wrote:
> On 04/12/2017 05:42 PM, Shawn H Corey wrote:
> > On Wed, 12 Apr 2017 16:19:32 -0400
> > Uri Guttman wrote:
> >
> >
> > my @array;
> >
> > for my $index (reverse sort @indices) {
> >> sort defaults to a lexical sort which won't work well on
On 04/12/2017 05:42 PM, Shawn H Corey wrote:
On Wed, 12 Apr 2017 16:19:32 -0400
Uri Guttman wrote:
my @array;
for my $index (reverse sort @indices) {
sort defaults to a lexical sort which won't work well on integers
with more than 2 digits.
and why are you sorting and reversing the indexes?
Quite! Even the slowest may find redemption in clarity :)
my @arr = qw( zero one two three ... );
my @del = qw( 2,4,... );
my( %del, @new );
@del{ @del } = ();
for (0..$#arr) { push @new, $arr[$_] unless exists $del{$_}}
On Wed, Apr 12, 2017 at 2:18 PM, Paul Johnson wrote:
> On Wed, Apr 12, 20
On Wed, 12 Apr 2017 16:19:32 -0400
Uri Guttman wrote:
> On 04/12/2017 04:08 PM, Илья Рассадин wrote:
> > Hi!
> >
> > You can use splice to delete elements from array.
> >
> > To delete multiple elements you need to do splice in a loop
> >
> > my @indices = qw/2 4 5 7/;
>
> why are you using qw w
On Wed, Apr 12, 2017 at 11:12:45PM +0200, David Emanuel da Costa Santiago wrote:
> Thank you all for your replies.
>
> I tested the 5 solutions with the benchmark module, and the splice one
> is the fastest:
> The hash one, which was my first solution is the slowest one. :-(
But they're all fas
Thank you all for your replies.
I tested the 5 solutions with the benchmark module, and the splice one
is the fastest:
Benchmark: timing 99 iterations of each, grep, hash, keep, splice...
each: 5 wallclock secs ( 5.07 usr + 0.00 sys = 5.07 CPU) @
197238.46/s (n=99)
grep: 5 wallc
On 04/12/2017 04:38 PM, Shlomi Fish wrote:
Hi Uri!
Some notes.
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 way to delete multiple indices from an array?
i'm doing:
---
my @array=qw
Hi Uri!
Some notes.
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 way to delete multiple indices from an array?
> >
> > i'm doing:
> >
> > ---
> > my @array=qw/zero one two th
On 04/12/2017 04:08 PM, Илья Рассадин wrote:
Hi!
You can use splice to delete elements from array.
To delete multiple elements you need to do splice in a loop
my @indices = qw/2 4 5 7/;
why are you using qw which makes strings and not a list of integers?
my @array;
for my $index (reverse
Hi!
You can use splice to delete elements from array.
To delete multiple elements you need to do splice in a loop
my @indices = qw/2 4 5 7/;
my @array;
for my $index (reverse sort @indices) {
splice @array, $index, 0;
}
12.04.17 22:19, Uri Guttman пишет:
On 04/12/2017 03:00 PM, David
On 04/12/2017 04:01 PM, David Emanuel da Costa Santiago wrote:
Thanks for your reply. I didn't think about that! :-)
While i was reading your email, i remembered about splice, so i guess
i'm going to end up with:
--
my @array=qw/zero one two three four five six seven eight nine ten/;
m
Thanks for your reply. I didn't think about that! :-)
While i was reading your email, i remembered about splice, so i guess
i'm going to end up with:
--
my @array=qw/zero one two three four five six seven eight nine ten/;
my @indicesToDelete = (2,4,6,7);
my $deviation = 0;
splice(@arra
On 04/12/2017 03:00 PM, David Emanuel da Costa Santiago wrote:
Hello!
What's the best way to delete multiple indices from an array?
i'm doing:
---
my @array=qw/zero one two three four five six seven eight nine ten/;
my @indicesToDelete = (2,4,6,7);
if you have the indexes to kee
I asked this just b/c I want to do matrix calculation in perl.
I found under some conditions a recursion is more effective.
Thanks everybody.
On 2017/3/29 23:31, Chas. Owens wrote:
On Tue, Mar 28, 2017 at 9:27 PM PYH mailto:p...@vodafonemail.de>> wrote:
Hi,
what's the better way to wr
On Tue, Mar 28, 2017 at 9:27 PM PYH wrote:
> Hi,
>
> what's the better way to write a recursion in perl's class?
>
> sub my_recursion {
> my $self = shift;
>
> if (...) {
> $self->my_recursion;
> }
> }
>
> this one?
>
Define better. In general that is the right
1 - 100 of 4039 matches
Mail list logo