Re: algorithms

2024-06-28 Thread karl
William Torrez Corea: > What is the difference between computer algorithms, pseudocode and source > code? I think this explains that: https://en.wikipedia.org/wiki/Algorithm https://en.wikipedia.org/wiki/Pseudo_code https://en.wikipedia.org/wiki/Source_code Regards, /Karl Hammar -- To

Re: regex matching statements

2024-06-19 Thread Levi Elias Nystad-Johansen via beginners
Hi, Yes, they are the same. I like to use $_ only when the data comes in $_ naturally. Like in a for loop: for (qw< abc >) { if ( !/\w+\d+/ ) { print "not matched"; } } Otherwise, I have to write $_, then I prefer to name the variable something descriptive instead. Makes the code

Re: Easiest Way in Perl to check Whether a Disk is Mounted

2024-06-06 Thread Jesús Lozano Mosterín
El 5/6/24 a las 22:28, Mike escribió: I sure couldn't figure out how to test for a mount with that module.  And I did go to 'man 2 mount'. Still couldn't figure it out. Mike On 6/1/24 18:29, Jeff P via beginners wrote: Of course, I can use system calls and call the unix mount or

Re: Easiest Way in Perl to check Whether a Disk is Mounted

2024-06-05 Thread karl
You can check if something is mounted by comparing which device a specific directory is on and comparing it to its parent directory. $ cat chk_mount.pl #!/usr/bin/perl -w use strict; use Fcntl ':mode'; my $A = $ARGV[0] // "/"; my $B = $ARGV[1] // "/var"; my @Ast = stat $A; my @Bst = stat $B;

Re: Easiest Way in Perl to check Whether a Disk is Mounted

2024-06-05 Thread Will Mengarini via beginners
* Martin McCormick [24-06/01=Sa 09:25 -0500]: > [...] determine whether a file system is mounted such as > $ mount |grep horseradish > [...] I think perl -e 'print grep m[/horseradish],`mount`' is hard to beat for its simplicity. Note I'm using Perl's built-in grep; there's no need to run the

Re: Easiest Way in Perl to check Whether a Disk is Mounted

2024-06-05 Thread Mike
I sure couldn't figure out how to test for a mount with that module.  And I did go to 'man 2 mount'. Still couldn't figure it out. Mike On 6/1/24 18:29, Jeff P via beginners wrote: Of course, I can use system calls and call the unix mount or mountpoint applications but is there a proper

Re: Easiest Way in Perl to check Whether a Disk is Mounted

2024-06-01 Thread Jeff P via beginners
Of course, I can use system calls and call the unix mount or mountpoint applications but is there a proper perl way to do this since system calls are not as elegant? Thank you. How about this module from metacpan? https://metacpan.org/pod/Sys::Linux::Mount regards. -- To unsubscribe,

Re: how to can measure my level of knowledge?

2024-05-31 Thread Rob Coops
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.

Re: crypt

2024-05-25 Thread Zheng Li Sheng
Hi, Maybe not being compiled with libcrypt ? What is the output of "perl -V | grep --color -i crypt" and "ldd /home/masayoshi/localperl/bin/perl" ? Regards, On Sat, May 25, 2024 at 4:00 PM Masayoshi Fujimoto wrote: > Hi. > OpenBSD does not work crypt. > Does it depends on OSes ? > Do you know

Re: project

2024-05-18 Thread karl
William: > What is the need to develop a project in Perl? Perl and some knowledge of what the project is about. You can, at your own convenience or requirement, add some version control system, some editor or progremming environment, etc. Regards, /Karl Hammar -- To unsubscribe, e-mail:

Re: module dependency

2024-05-16 Thread sisyphus
At the command prompt, run: perl -le 'use Net::SMTPS; print for keys %INC;' That will tell you the names of all of the modules that get loaded when you load Net::SMTP. Cheers, Rob On Thu, May 16, 2024 at 11:07 PM Netwinds wrote: > greetings everybody, > > How do I know which other modules are

Re: module dependency

2024-05-16 Thread karl
Netwinds: > How do I know which other modules are required by the perl module > (like Net::SMTPS) I am using? You mean like go to cpan: https://metacpan.org/pod/Net::SMTPS and looking at the left column under dependencies ? Regards, /Karl Hammar -- To unsubscribe, e-mail:

Re: stage of programming

2024-05-14 Thread Misti Hamon
So, uh, this depends. The couple of times I went through the process of working for a "client" (in quotes because it was in school, and was an exercise they did trying to teach us about freelancing) it was handled two ways - client finds you and says "I need a program that takes this information

Re: lines of code for code a website

2024-05-03 Thread Levi Elias Nystad-Johansen via beginners
This depends on the complexity and size of the website. A very simple website needs 0 lines of C, Java, PHP, or Perl - since it can be made with only HTML. Big and complex websites might need 100.000s lines of code, in multiple languages. -L On Friday, May 3rd, 2024 at 8:27 AM, William Torrez

Re: [announcements mailing list]

2024-03-20 Thread Mike
I am subscribed to the Perl Weekly: https://perlweekly.com/ Mike On 3/15/24 06:27, Maxim Abalenkov wrote: Dear all, How are you? I hope all is well with you. I’m wondering, do we have some kind of an announcements mailing list, that would highlight, what happened in the Perl world over

Re: [announcements mailing list]

2024-03-15 Thread sisyphus
On Fri, Mar 15, 2024 at 10:27 PM Maxim Abalenkov wrote: > Dear all, > > How are you? I hope all is well with you. I’m wondering, do we have some > kind of an announcements mailing list, that would highlight, what happened > in the Perl world over the past week, month, quarter? What are the new >

Re: [announcements mailing list]

2024-03-15 Thread Andrew Solomon
Hi Maxim, This is the mailing list I see as a good source of general updates from the Perl and Raku community: https://perlweekly.com/ This is a more formal news site maintained by The Perl Foundation: https://news.perlfoundation.org/ This site was once providing lots of articles but needs

Re: Upgrade from Debian 11 to Debian 12 Broke Perl.

2024-03-13 Thread Ruprecht Helms (privat)
-gnu/perl/5.36 /usr/share/perl/5.36 /usr/local/lib/site_perl) at /home/martin/etc/p2 line 3. BEGIN failed--compilation aborted at /home/martin/etc/p2 line 3. So, if I try to use cpanp and re-add that module, I get: 1wb5agz martin tmp $ cpanp -i Warnings::Unused ERROR] 'Warnings::Unused' does

Re: Upgrade from Debian 11 to Debian 12 Broke Perl.

2024-03-13 Thread Ruprecht Helms (privat)
line 3. So, if I try to use cpanp and re-add that module, I get: 1wb5agz martin tmp $ cpanp -i Warnings::Unused ERROR] 'Warnings::Unused' does not contain an author part [ERROR] Cannot find 'Warnings::Unused' in the module tree “Warnings::Unused” != “warnings::unused” Try `cpanp warnings

Re: Upgrade from Debian 11 to Debian 12 Broke Perl.

2024-03-11 Thread John SJ Anderson
x-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.36 > /usr/share/perl/5.36 /usr/local/lib/site_perl) at /home/martin/etc/p2 line 3. > BEGIN failed--compilation aborted at /home/martin/etc/p2 line 3. > > So, if I try to use cpanp and re-add that module, I get: > > 1wb5agz marti

Re: [install and use local::lib module]

2024-02-17 Thread Mike
. Mike F. Houston, TX On 2/15/24 04:23, Maxim Abalenkov wrote: Dear all, How are you? I re-read the README file of the local::lib module. There was one more command missing: echo 'eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib)"' >>~/.bashrc My new Perl settings in t

Re: [install and use local::lib module]

2024-02-15 Thread Kang-min Liu
Maxim Abalenkov writes: > Now everything works. But I still don’t understand the setup very > well. What is the difference between the ‘.cpan’ and ‘perl5’ > directories? What is their purpose? Thank you and have a great day > ahead! The directory ~/.cpan/ is where the command `cpan` saves its

Re: https://metacpan.org/pod/OpenOffice::OODoc

2024-02-09 Thread Mike
I don't. Mike On 1/31/24 16:51, hw wrote: Ok and how do you do it with OpenOffice::OODoc? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: https://metacpan.org/pod/OpenOffice::OODoc

2024-01-31 Thread hw
On Tue, 2024-01-30 at 20:45 -0600, Mike wrote: > FWIW, in Spreadsheet::WriteExcel I do this: Ok and how do you do it with OpenOffice::OODoc? > $sheet = $book1 -> worksheets(2) -> {Name}; > $sheet = $book1 -> worksheets($sheet); > $sheet -> Activate; > > $sheet -> Range("B2") -> Activate; > $ex

Re: https://metacpan.org/pod/OpenOffice::OODoc

2024-01-30 Thread Mike
FWIW, in Spreadsheet::WriteExcel I do this: $sheet = $book1 -> worksheets(2) -> {Name}; $sheet = $book1 -> worksheets($sheet); $sheet -> Activate; $sheet -> Range("B2") -> Activate; $ex -> ActiveWindow -> {FreezePanes} = "True"; Mike On 1/28/24 16:26, hw wrote: So how do I freeze

Re: Are there any ALSA Perl Modules?

2024-01-29 Thread sisyphus
On Mon, Jan 29, 2024 at 6:28 AM Martin McCormick wrote: [snip] > I may be looking in the wrong places but, so far, I seem > to be batting zeros when looking for perl and alsa together. > I take it that MIDI::ALSA (https://metacpan.org/pod/MIDI::ALSA) has little or nothing to offer ?

Re: Are there any ALSA Perl Modules?

2024-01-29 Thread Olivier
Shlomi Fish writes: >> Anyway, the FFI concept will probably someday come in >> handy for a different project so I will continue with the C I was >> working on. What I did in a project is having the main functionality written in C, but using Perl for things that could be handy like parsing

Re: Are there any ALSA Perl Modules?

2024-01-29 Thread Shlomi Fish
hi Martin, On Mon, 29 Jan 2024 22:38:27 -0600 "Martin McCormick" wrote: > Shlomi Fish writes: > > hi Martin, > > you can try using an FFI, eg: > > > > https://metacpan.org/dist/Inline-C/view/lib/Inline/C.pod > > > > https://metacpan.org/dist/Inline-Python/view/Python.pod > > > >

Re: Are there any ALSA Perl Modules?

2024-01-29 Thread Martin McCormick
Shlomi Fish writes: > hi Martin, > you can try using an FFI, eg: > > https://metacpan.org/dist/Inline-C/view/lib/Inline/C.pod > > https://metacpan.org/dist/Inline-Python/view/Python.pod > > https://metacpan.org/pod/FFI::Platypus Many thanks. I am glad I asked the question but it has taken me

Re: Are there any ALSA Perl Modules?

2024-01-28 Thread Shlomi Fish
hi Martin, On Sun, 28 Jan 2024 13:27:45 -0600 "Martin McCormick" wrote: > Several years ago, I wrote some C code which turns one's > computer's sound interface in to a sound-activated recorder that > I could then connect to radio receivers or microphones and record > when audio started and stop

Re: https://metacpan.org/pod/OpenOffice::OODoc

2024-01-28 Thread hw
On Sun, 2024-01-28 at 22:44 +0100, hw wrote: > Hmm, cellValue() always puts text. How do I put numbers and formulars > instead? Ok, it's cellFormula(), and you have to change the value type of every cell that should contain anything having a type different from the default type of the sheet.

Re: Are there any ALSA Perl Modules?

2024-01-28 Thread hw
On Sun, 2024-01-28 at 13:27 -0600, Martin McCormick wrote: > [...] > I may be looking in the wrong places but, so far, I seem > to be batting zeros when looking for perl and alsa together. > > Any good ideas are greatly appreciated, here. I would think that one nowadays would use (go

Re: https://metacpan.org/pod/OpenOffice::OODoc

2024-01-28 Thread hw
On Sun, 2024-01-28 at 12:21 -0800, Jim Gibson via beginners wrote: > Check out the OpenOffice::OODoc module on CPAN: > > > The documentation is a little sparse, especially with regard to “spreadsheet” > mode, and I don’t have Libre Office on my

Re: https://metacpan.org/pod/OpenOffice::OODoc

2024-01-28 Thread Jim Gibson via beginners
Check out the OpenOffice::OODoc module on CPAN: The documentation is a little sparse, especially with regard to “spreadsheet” mode, and I don’t have Libre Office on my system to test it out, but the following code produces an ods file that can

Re: https://metacpan.org/pod/OpenOffice::OODoc

2024-01-28 Thread hw
On Thu, 2024-01-25 at 20:28 -0600, Mike wrote: > It can be done with a Perl module: > https://unix.stackexchange.com/questions/723650/editing-libreoffice-calc-spreadsheets-in-the-terminal > > I have not tested that. I do not want to edit spreadsheets in a terminal. There's some other software

Re: https://metacpan.org/pod/OpenOffice::OODoc

2024-01-25 Thread Mike
It can be done with a Perl module: https://unix.stackexchange.com/questions/723650/editing-libreoffice-calc-spreadsheets-in-the-terminal I have not tested that. Mike On 1/25/24 13:05, hw wrote: Hi, is there a way to create libreoffice spreadsheets (ods) similar to Excel::Writer::XLSX?

Re: regex

2024-01-24 Thread karl
Mike: > I stand properly scolded. I didn't want to scold anyone, it seems I expressed myself wrong. Sorry for that. Regards, /Karl Hammar -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: regex

2024-01-23 Thread Mike
I stand properly scolded. Mike On 1/23/24 07:01, k...@aspodata.se wrote: Please stop using my mail address when replying, I'm on the list and don't want two copies of the same mail (it's not about you Mike). -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional

Re: regex

2024-01-23 Thread karl
Please stop using my mail address when replying, I'm on the list and don't want two copies of the same mail (it's not about you Mike). Mike > Why is my Perl not working on that command? > > $ perl -e 'exit(10) if "aaa"=~/a{,2}/;' > Unescaped left brace in regex is illegal here in regex; marked

Re: regex

2024-01-22 Thread Mike
Why is my Perl not working on that command? $ perl -e 'exit(10) if "aaa"=~/a{,2}/;' Unescaped left brace in regex is illegal here in regex; marked by <-- HERE in m/a{ <-- HERE ,2}/ at -e line 1. $ But this works: $ perl -e 'exit(10) if "aaa"=~/a{0,2}/;' $ $ echo $? 10 $ It sure surprised

Re: regex

2024-01-22 Thread armando perez pena
have a problem and you say I will solve it with regular expressions then you have two problems. Ánimos! Saludos From: Claude Brown via beginners Sent: Monday, January 22, 2024 10:49:50 PM To: k...@aspodata.se ; beginners@perl.org Subject: RE: regex Jorge

RE: regex

2024-01-22 Thread Claude Brown via beginners
Jorge, Expanding on Karl's answer (and somewhat labouring his point) consider these examples: $a =~ /Jorge/ $a =~ /^Jorge/ $a =~ /Jorge$/ $a =~ /^Jorge$/ This shows that regex providing four different capabilities: - detect "Jorge" anywhere in the string - detect "Jorge" at the start of a

Re: regex

2024-01-22 Thread Levi Elias Nystad-Johansen via beginners
I agree that this is confusing, and I think many resources describing regex in unhelpful ways is partly to blame. descriptions like "pattern that matches against a string" and similar. this implies that a regex has to match the string, but this is not the case. a regex does not have to match the

Re: regex

2024-01-22 Thread Andy Bach
Yes, the {}l RE modifier has the canonical form {a,b} where a and b are numbers and so that modifies the char before it to match from a to b times, e,g A{1,3} matches one, two or three As. If you leave out the first number, zero is presumed. Hmm, perl 5.30 % perl -E 's ay(10) if "aaa&qu

Re: regex

2024-01-22 Thread karl
Jorge Almeida: > On Mon, 22 Jan 2024 at 13:00, wrote: > > Jorge Almeida: > > > $ perl -e 'exit(10) if "aaa"=~/a{,2}/;' ... > > {,n}Match at most n times ... > Yes, I read it (several times). I still don't understand it (I understand > what you're saying, and I trust you're right, I just

Re: regex

2024-01-22 Thread karl
Jorge Almeida: > Please help me to understand this: > $ perl -e 'exit(10) if "aaa"=~/a{,2}/;' > $ echo $? > $ 10 In man perlre, under "Regular Expressions" it says: {,n}Match at most n times So /a{,2}/ matches "", "a", and "aa" and is ignorant about what comes before and after

RE: Using UNIX domain sockets

2024-01-15 Thread Claude Brown via beginners
The first difference I can see is that "echo" adds a newline, but your perl does not. Try adding the newline: my $cmd='{"command":["stop"]}' . "\n"; This is a wild guess! -Original Message- From: listas.correo via beginners Sent: Tuesday, January 16, 2024 6:26 AM To:

Re: How to reboot?

2024-01-15 Thread hw
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 > 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

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: How to reboot?

2024-01-13 Thread hw
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 >

Re: lambda array

2024-01-13 Thread Ken Slater
On Sat, Jan 13, 2024 at 12:41 PM Andrew Solomon wrote: > > when is an array in perl declared with [] instead of ()? > > Using the [ ] delimiters you are creating a *reference* to an array. > (Think of a reference as the memory address where the array is stored). So > > my $foo = [1,2,3]; > > is

Re: lambda array

2024-01-13 Thread Andrew Solomon
> when is an array in perl declared with [] instead of ()? Using the [ ] delimiters you are creating a *reference* to an array. (Think of a reference as the memory address where the array is stored). So my $foo = [1,2,3]; is equivalent to the following, because given an array the \ gets the

Re: lambda array

2024-01-13 Thread hw
On Sat, 2024-01-13 at 15:00 +, Andrew Solomon wrote: > I think the line: > > reply_multi( \$daemon{xmpp_o}, \($adminuser{fromJID}, $fromJID), "blah" ); > > should have \(...) replaced with [ ... ] : > > reply_multi( \$daemon{xmpp_o}, [$adminuser{fromJID}, $fromJID], "blah" ); > > because

Re: How to reboot?

2024-01-13 Thread hw
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

Re: How to reboot?

2024-01-13 Thread hw
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

Re: lambda array

2024-01-13 Thread Andrew Solomon
I think the line: reply_multi( \$daemon{xmpp_o}, \($adminuser{fromJID}, $fromJID), "blah" ); should have \(...) replaced with [ ... ] : reply_multi( \$daemon{xmpp_o}, [$adminuser{fromJID}, $fromJID], "blah" ); because \('foo', 'bar') evaluates to (\'foo', \'bar') Does that clarify this for

RE: How to reboot?

2024-01-13 Thread twlewis via beginners
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

Re: How to reboot?

2024-01-12 Thread Andinus via beginners
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:

Re: How to reboot?

2024-01-12 Thread hw
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',

Re: How to reboot?

2024-01-12 Thread Andinus via beginners
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

Re: [getting PAUSE account]

2024-01-12 Thread Andrew Solomon
Hi Maxim, I'm sorry to hear this hasn't been resolved! I've just asked on the perl-help irc.perl.org channel - feel free to join in, but otherwise I'll let you know what I learn. Kind regards, Andrew On Fri, Jan 12, 2024 at 6:00 AM Maxim Abalenkov wrote: > Dear all, > > How are you? Thank

Re: Knowledge for a basic programmer and advanced programmer

2024-01-05 Thread John SJ Anderson
> If you are coding you should be backing up every > 10 minutes or more often. And you should store > a "historical" full copy of the code every 30 minutes > or more often and save them for days. No, you shouldn’t, because it is no longer 1985. You should learn how to use version control; the

Re: Knowledge for a basic programmer and advanced programmer

2024-01-05 Thread Mike
If you are coding you should be backing up every 10 minutes or more often.  And you should store a "historical" full copy of the code every 30 minutes or more often and save them for days. Mike On 1/2/24 10:33, William Torrez Corea wrote: On Tue, Jan 2, 2024 at 5:17 AM Shlomi Fish wrote:

Re: [getting PAUSE account]

2024-01-02 Thread Rob Coops
Just my two cents on this. There is no sense in putting one language over another if it is for personal use. In those cases use what you want and what you feel is best suited to your needs. You might Choose Perl as you are familiar with it and you need to process lots and lots of text for your

Re: Knowledge for a basic programmer and advanced programmer

2024-01-02 Thread Shlomi Fish
On Sat, 16 Dec 2023 08:10:49 -0600 William Torrez Corea wrote: > What needs to know a basic and advanced programmer? > > I am a basic programmer, I don't have enough experience to be an advanced > programmer. > > How many years of experience must an advanced programmer have? > hi William, I

Re: [getting PAUSE account]

2024-01-01 Thread Mike
That is true.  I don't see the appeal with Python, but I have barely dabbled in it.  I code for me and I know Perl.  I don't have the motivation to learn a new language. Perl works well, so I use it. Mike On 12/25/23 22:05, William Torrez Corea wrote: I am a beginner, I am learning of the

Re: [getting PAUSE account]

2023-12-25 Thread Mike
Great question.  I think I did see that Pause accounts were going away soon, but I'm not sure that has taken place yet.  I just signed into my Pause account and I don't see anything about them being retired. This 3 year old post says it takes a bit of time:

Re: perlbrew

2023-11-22 Thread Olivier
Hi, > > Try to change the version of my Perl but not change. What do you do to change the version of Perl? What command? On what system? > I have Perl v5.36.1, I tried to change Perl to Perl v5.10.0 but I didn't get > the > desired effect. > > I have the following error: > > A sub-shell is

Re: Using qr// with substitution and group-interpolation in thesubstitution part

2023-11-21 Thread gordonfish
On 10/25/23 10:32, Josef Wolf wrote: [...] Basically, I want to do the same as $data =~ s/^foo (whatever) bar$/bar $1 baz/mg; but with a different interface (because it has to be embedded into a bigger project), So I have come with this; sub substitute_lines { my ($contents,

Re: Perl Design Patterns

2023-11-18 Thread wesley
you can choose to not use it. > > When must I use perl design patterns? > -- > > With kindest regards, William. > > ⢀⣴⠾⠻⢶⣦⠀ > ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system > ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org https://www.debian.org/ > ⠈⠳⣄ > -- To unsubscribe, e-mail:

Re: Preference

2023-10-30 Thread Rob Coops
In this day and age Kotlin is probably your best bet but if you take on Java you are 90% there with regards to Kotlin. As for Perl, unless you are in a very specific niche Perl is pretty much dead as a commercially viable option as there are too few people that are halfway decent at it so no

RE: Preference

2023-10-28 Thread Claude Brown via beginners
I’d go with Java, in order: * Popularity – there is just more stuff being written in Java. This would indicate the employment options are greater. * https://www.tiobe.com/tiobe-index/ * Java currently rates 4th vs Perl at 27th * Over the long arc, Java probably has a

Re: Using qr// with substitution and group-interpolation in the substitution part

2023-10-26 Thread Octavian Rasnita
x/$subst/gm; my @matches = @{^CAPTURE}; $contents =~ s/\$$_/$matches[$_-1]/g for 1 .. @matches; return $contents; } - Original Message - From: "Claude Brown via beginners" To: "Levi Elias Nystad-Johansen" ; "Andrew Solomon" Cc: "Jos

RE: Using qr// with substitution and group-interpolation in the substitution part

2023-10-25 Thread Claude Brown via beginners
things" command on your system. -Original Message- From: Claude Brown via beginners Sent: Thursday, October 26, 2023 8:07 AM To: Levi Elias Nystad-Johansen ; Andrew Solomon Cc: Josef Wolf ; beginners@perl.org Subject: RE: Using qr// with substitution and group-interpolation

RE: Using qr// with substitution and group-interpolation in the substitution part

2023-10-25 Thread Claude Brown via beginners
Josef, Inspired by Levi's “eval” idea, here is my solution: sub substitute_lines { my ($contents, $regex, $subst) = @_; eval "\$contents =~ s/$regex/$subst/g"; return $contents; } $data = "foo whatever bar"; $data = _lines($data, qr/^foo (whatever) bar$/m, 'bar $1 baz'); print

Re: Using qr// with substitution and group-interpolation in the substitution part

2023-10-25 Thread Andrew Solomon
Which (mostly) works as expected. Unfortunately, this won't interpolate the > matched group $1. > > Experiments which also do not work: > > > _lines ($data, qr/^foo (whatever) bar$/mg, "bar $1 baz"); > # obviously, $1 is interpolated _before_ re-match is done > >

Re: Modules

2023-10-24 Thread John Harris Gmail
What modules and/or libraries are you using? Before you code do you block diagram and flowchart your programs? On Tue, Oct 24, 2023, 12:06 PM Levi Elias Nystad-Johansen via beginners < beginners@perl.org> wrote: > I use modules for complex things that I might get wrong. To re-

Re: Modules

2023-10-24 Thread Levi Elias Nystad-Johansen via beginners
I use modules for complex things that I might get wrong. To re-use other people's code is often better than to re-invent their solutions. https://metacpan.org/pod/WWW::Mechanize::Examples has some good examples of useful scripts that are short and simple. Imagine how hard it would be to write

Re: Tool for develop in Perl

2023-10-23 Thread John Tebbe
I use this, it an old one but it meets my needs: https://sourceforge.net/projects/open-perl-ide/ On 10/23/2023 6:55 AM, Ruprecht Helms wrote: An Alternative for VIM or Emacs is the Nano-Editor. Maybe the IDE Eclipse is able to assist you in developing perl-code. But like to use Eclipse for

Re: Tool for develop in Perl

2023-10-23 Thread Ruprecht Helms
An Alternative for VIM or Emacs is the Nano-Editor. Maybe the IDE Eclipse is able to assist you in developing perl-code. But like to use Eclipse for PHP-Developing, Handling SQL, ... you have to install a plugin to add this oppertunity. By default Eclipse is a IDE for Java-Developing.

Re: Tool for develop in Perl

2023-10-22 Thread Francisco Valladolid H.
The only thing that you need for develop in perl is vi/vim and Unix like terminal. Regards On Sun 22 Oct 2023 at 1:38 p.m. Vlado Keselj wrote: > > I use Emacs. > > On Fri, 20 Oct 2023, William Torrez Corea wrote: > > > What tool can I use for development in Perl? > > > > I use VIM for coding

Re: Tool for develop in Perl

2023-10-22 Thread Vlado Keselj
I use Emacs. On Fri, 20 Oct 2023, William Torrez Corea wrote: What tool can I use for development in Perl? I use VIM for coding and executing programs with the Perl Command Line from GNU/Linux. In addition I have installed Eclipse but the IDE is abandoned. My theory: I can make full

Re: Tool for develop in Perl

2023-10-22 Thread Lars Noodén via beginners
On 10/21/23 07:48, William Torrez Corea wrote: What tool can I use for development in Perl? I use VIM for coding and executing programs with the Perl Command Line from GNU/Linux. In addition I have installed Eclipse but the IDE is abandoned. My theory: I can make full development from VIM but

RE: Tool for develop in Perl

2023-10-22 Thread Claude Brown via beginners
I am 99% using “vi” and sometimes Notepad++.I do not like heavy-weight IDE’s – I find they get in the way. I have colleagues using Visual Studio and they say it is great. Yet, I’m more productive  I reckon they spend too much time messing around with the tool trying to make it do what

Re: Fast of program

2023-10-16 Thread Andy Bach
Keeping in mind Knuth's axiom: "Premature optimization is the root of all evil" https://wiki.c2.com/?PrematureOptimization On Mon, Oct 16, 2023 at 12:40 PM Levi Elias Nystad-Johansen via beginners < beginners@perl.org> wrote: > Before optimizing, it is recommended to run a profiler to see

Re: Syntax of Perl

2023-10-10 Thread Olivier
I am not sure about ruby, but if we want to be chronologically correct, it's python that has a syntax that may look like Perl. Olivier -- -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: Syntax of Perl

2023-10-09 Thread wesley
I would say perl syntax is similar to ruby and scalar. https://tech.postno.de/archives/113 regards. > > The syntax of Perl have similarity with Python. > > -- > > With kindest regards, William. > > ⢀⣴⠾⠻⢶⣦⠀ > ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system > ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org

Re: Perl version 5.8 and 5.10

2023-10-08 Thread Levi Elias Nystad-Johansen via beginners
Hi, What is your use case, maybe it can be solved by adding "use v5.8;" or "use v5.10;" at the top? It is rarely needed to install such an old version of perl, unless it's for testing compatibility, but then we should aim higher than v5.8. v5.16 is the oldest version supported by toolchain,

Re: Perl version 5.8 and 5.10

2023-10-08 Thread wesley
ably is better try to update it.  > > Best Regards, > > Armando > > > > **From:** Kang-min Liu > **Sent:** Sunday, October 8, 2023 5:32:24 AM > **To:** beginners@perl.org > **Subject:** Re: Perl version

Re: Perl version 5.8 and 5.10

2023-10-08 Thread armando perez pena
Hello, What's the motivation to install a version which is 21 years old ? If you have an old code probably is better try to update it. Best Regards, Armando From: Kang-min Liu Sent: Sunday, October 8, 2023 5:32:24 AM To: beginners@perl.org Subject: Re: Perl

Re: Perl version 5.8 and 5.10

2023-10-07 Thread Kang-min Liu
於 2023年10月8日 上午11:53:46 [GMT+09:00],William Torrez Corea 寫到: >I Tried to install perl version 5.8 and 5.10 with perlbrew but i can't >install this version. >I get the following error message: > >50 tests and 269 subtests skipped. >> make[2]: *** [makefile:701: _test_tty] Error 29 >> make[2]:

Re: Upgrade Perl

2023-10-06 Thread Robbi Nespu
On 6/10/2023 3:03 am, William Torrez Corea wrote: How to upgrade Perl from Debian? I have Perl *v5.32.1* -- With kindest regards, William. ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org ⠈⠳⣄ I think you are using

Re: Upgrade Perl

2023-10-05 Thread Mike Hübschen
I use https://perlbrew.pl/ Best regards, Mike On 10/5/23 21:03, William Torrez Corea wrote: How to upgrade Perl from Debian? I have Perl *v5.32.1* -- With kindest regards, William. ⢀⣴⠾⠻⢶⣦⠀ ⣾⠁⢠⠒⠀⣿⡁ Debian - The universal operating system ⢿⡄⠘⠷⠚⠋⠀ https://www.debian.org

Re: Code or tools

2023-08-17 Thread Lars Noodén
nonetheless. The reason for that vote is that you read the code so many more times than you write it. In fact you keep reading it while you write it, even before you forget what's in it and have to re-read it yet again to refresh your mind on how it works and what it does specifically. Then your

Re: My progress in Perl

2023-08-08 Thread Olivier
Vlado Keselj writes: > I believe that > Perl still comes installed by default in the most popular distributions. Not in FreeBSD, and that's a shame! Olivier -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org

Re: My progress in Perl

2023-08-08 Thread Vlado Keselj
.  We barely > know Python, so it will be a difficult – but necessary – journey. > > Cheers, > > > Claude. > >   > >   > > From: Steve Park > Sent: Tuesday, August 8, 2023 11:49 AM > To: Andy Bach > Cc: William T

Re: My progress in Perl

2023-08-08 Thread Steve Park
ay, August 8, 2023 11:49 AM > *To:* Andy Bach > *Cc:* William Torrez Corea ; beginners@perl.org > *Subject:* Re: My progress in Perl > > > > *CAUTION:* This email originated from outside of the organization. Do not > click links or open attachments unless you recognize the sender a

Re: My progress in Perl

2023-08-08 Thread William Ward via beginners
> Perl and Python learn both. There is nothing bad with that. > > Br, > Armando > From: Mike > Sent: Monday, August 7, 2023 12:56:35 PM > To: beginners@perl.org > Subject: Re: My progress in Perl > > > "Try to learn by doing something that you need.&qu

Re: My progress in Perl

2023-08-07 Thread Levi Elias Nystad-Johansen via beginners
Hi, Learning Perl is a great book, but anyone looking for an alternative should check out Minimal Perl by Tim Maher. I've found this book to be a little clearer and with more practical examples. I've used Perl on windows for years, as it is far more powerful and portable than Batch and

Re: My progress in Perl

2023-08-07 Thread Olivier
Out off topic rant... > Honestly, my advise is if you are beginning to learn programming using > perl in 2023. Don't. > > Pick up python and go from there. My problem with Python (beside my inability to think oriented object) is the very bad choice to have idents to represent blocks hierarchy.

  1   2   3   4   5   6   7   8   9   10   >