perl.beginners https://www.nntp.perl.org/group/perl.beginners/ ... Copyright 1998-2025 perl.org Fri, 09 May 2025 07:03:41 +0000 ask@perl.org Turning Perl Code in to C++ I Think I've found what I needed. (1 message) After doing more searching, what I appear to need is perlembed. It&#39;s<br/>been around since early versions of perl 5 and the systems <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/>in<br/>question will be running perl5.36. One puts a perl interpreter<br/>in to the C source and that should enable what I was asking<br/>about. Sorry to waste everybody&#39;s time.<br/><br/>Martin<br/> https://www.nntp.perl.org/group/perl.beginners/2025/05/msg127904.html Thu, 08 May 2025 02:29:43 +0000 Turning Perl Code in to C++ (1 message) Is it possible these days to write perl code and then turn it in<br/>to C++ that one could then put in to a C++ program?<br/><br/> I am writing a c++ program that will deal with PCM audio<br/>and alsa sound functions which are good at managing sound cards<br/>so that one can get a stream of binary audio from the card at the<br/>rate and format for the job at hand.<br/><br/> C++ and gcc are both very good at this with c++ being a<br/>little more useful in compiling routines that access the right<br/>libraries.<br/><br/> Perl, on the other hand is wonderful at munching and<br/>crunching text such as text-based configuration files in which<br/>one usually reads a string and splits it based on delimiters to<br/>assign values to one&#39;s program.<br/><br/> The hope, here, is to use the strengths of perl to write<br/>code that does what I want for handling configuration files and<br/>then use c++ for the logic of the sound handler where it really<br/>shines.<br/><br/> In c++, one certainly can write code to open and read<br/>text files but making something good happen in c++ takes longer<br/>and what one ends up with is not nearly as nice as what one gets<br/>with the string handling functions that are part of perl.<br/><br/> What is ironic is that perl uses these functions in C so<br/>basically, I am trying to find a lazier way to get past the<br/>opening part of my program. The configuration part happens right<br/>as the program starts and is never needed after that point. The<br/>C++ part, on the other hand runs after all the values are set<br/>until one kills the program.<br/><br/> Unless I am missing something, there don&#39;t seem to be<br/>many sound modules in perl because they would have to work in<br/>unix and Windows environments so I am not complaining but perl<br/>also can do bit-wise binary operations so I looked in to seeing<br/>if my sound handler could be written in perl but you&#39;d have to<br/>use system calls to aplay and arecord or start from bare metal to<br/>get the same function that aplay and arecord give you. You can<br/>do that but aplay and arecord are already there and work fine so<br/>there is no reason to reinvent the wheel.<br/><br/> I could be wrong about everything I have just written so<br/>I am looking for ideas.<br/><br/> The C programming for handling the sound is nothing<br/>fancy, mainly splitting the left and right channels from the<br/>standard 32-bit int that sound cards generate with each sample.<br/>Also, the samples are 16 bits and communications-grade sound can<br/>work with 8-bit samples so all one has to do there is just use the<br/>upper 8 bits for the actual PCM audio.<br/><br/> I am interested in any constructive ideas as to how to<br/>take advantage of the easier text handling of perl but use the<br/>binary features of c for the actual engine that reads the sound<br/>and stores it in files.<br/><br/> Many thanks.<br/><br/>Martin McCormick<br/> https://www.nntp.perl.org/group/perl.beginners/2025/05/msg127903.html Wed, 07 May 2025 18:08:32 +0000 Regex To get the Job Number and Corresponding state (6 messages) Hi All,<br/><br/>I have a requirement to use regex , find the Job ID for the Current<br/>status: SUCCEEDED and Current Phase: &quot;ZDM_SETUP_TGT&quot; from a file<br/>which has data in the format gives below :<br/><br/>Job ID: 52<br/>User: zdmuser<br/>Client: zdmhost<br/>Job Type: &quot;EVAL&quot;<br/>...<br/>Current status: SUCCEEDED<br/>Current Phase: &quot;ZDM_SETUP_TGT&quot;<br/><br/><br/>Thanks,<br/> https://www.nntp.perl.org/group/perl.beginners/2025/02/msg127897.html Tue, 25 Feb 2025 16:49:24 +0000 Removing a space from file name (6 messages) I have several hundred *.jpg files with this pattern<br/><br/>Actual example:<br/><br/> &#39;AtlantaVisitAndGrandmaHands 056.jpg&#39;<br/><br/>The numbers vary, of course, but the alpha part and number of digits<br/>after the space is the same in all *.jpg files<br/><br/>I have hundreds of these all in one directory. Not something you&#39;d<br/>want to do one at a time.<br/><br/>I tried to figure a way using the perl `rename&#39; tool found in many linux<br/>distro&#39;s repos<br/><br/>But couldnt figure out the necessary syntax from Larry Wall&#39;s examples<br/>in the rename man page. Using the &quot;s///&quot; operators , it&#39;s probably<br/>there some how but my pea brain isn&#39;t seeimg it.<br/><br/>bash has just used the apostrophes to make the names usable but<br/>I would much rather remove the space.<br/><br/> https://www.nntp.perl.org/group/perl.beginners/2025/02/msg127891.html Mon, 17 Feb 2025 17:38:42 +0000 Linux Directory Copy Modules that Won't (5 messages) This is perl 5, version 36, subversion 0 (v5.36.0) built for x86_64-linux-gnu-thread-multi <br/>(with 53 registered patches, see perl -V for more detail) <br/> <br/>Copyright 1987-2022, Larry Wall <br/> <br/> The issue here is trying to copy directories of files <br/>from the main SSD drive to various thumb drivesthat must be <br/>mounted on the system for the copy to occur. <br/> <br/> The program flawlessly did every single thing I told it to <br/>so there are up to 4 directories, each with a mounted thumb drive <br/>sitting there waiting on pins and needles for the gush of <br/>anticipated data but the only way I&#39;ve gotten this to work in the <br/>past is to cheat by using the system command and standard unix <br/>copying commands as in: <br/> <br/> system(&quot;cp -p -r \&quot;$docname\&quot; \&quot;/$guides[1]\&quot;/&quot;); <br/> <br/> The way this program was supposed to copy a disk folder <br/>to a corresponding thumb drive is written: <br/> <br/> dircopy (&quot;\&quot;weekly\&quot;, \&quot;/weekly/\&quot;&quot;) or die!$; <br/> <br/> It always dies at the copy command and it is nothing to <br/>do with permissions as I can sit here and execute a command from <br/>the shell like: <br/> <br/>date &gt;/weekly or whatever the mounted drive is called and the command <br/>succeeds normally. <br/> <br/> Here is the first part of the program which is 137 lines <br/>long and nothing else is failing except for the directory copies: <br/> <br/>#!/usr/bin/perl -w <br/>use strict; <br/>use warnings::unused; <br/>use IO::Handle; <br/>use File::HomeDir; <br/>use Cwd qw(getcwd); <br/> <br/>#use File::Copy &quot;cp&quot;; <br/>use File::Copy::Recursive qw(fcopy rcopy dircopy fmove rmove dirmove); <br/>use File::Find; <br/>use File::Spec; <br/> <br/> I suspect several of those modules aren&#39;t needed but the <br/>program does exactly what I need it to do until the copy occurs. <br/>The directories are their and populated with other directories <br/>which should all be copied to selected thumb drives as whole <br/>directories and running in debug mode as in perl -d shows thit to <br/>be true so the only issue to solve is that dircopy command. You <br/>will notice another File::Copy module commented out that is <br/>supposed to take cp commands but didn&#39;t either. It boils down to <br/>none of these copy modules appear to be working in this case. <br/> <br/> The actual copy command I am using is: <br/> <br/> dircopy(&quot; $dir , /$dir&quot;) or die !$; <br/>$dir in this case is the directory name which could be one of 4 <br/>possible names but it doesn&#39;t matter because there has not been <br/>one bit copied using either of the two modules I tried and the <br/>dircopy module does exactly what one needs in this particular <br/>case but silently fails 100% of the time. <br/> <br/>Thanks for any good ideas since this appears to be quite useful <br/>but hasn&#39;t shown that side of it&#39;s behavior yet. <br/> <br/>Martin McCormick <br/> https://www.nntp.perl.org/group/perl.beginners/2025/02/msg127886.html Sat, 01 Feb 2025 14:34:41 +0000 iterate over the use-d modules (5 messages) Hi all,<br/>is there a way to iterate over the used modules, I mean every symbol<br/>loaded with use?<br/>I would like to do something like:<br/><br/>use Foo;<br/>use Bar;<br/><br/>say ${ $_ }::VERSION for ( @used );<br/><br/>and get something like<br/><br/>say $Foo::VERSION;<br/>say $Bar::VERSION;<br/><br/><br/>Thanks,<br/>Luca<br/> https://www.nntp.perl.org/group/perl.beginners/2024/10/msg127881.html Tue, 01 Oct 2024 10:20:49 +0000 What is best way for learn programming? (16 messages) 1. Course <br/> 2. Books <br/> 3. Documentation <br/> 4. Projects <br/> <br/>I was learning programming with a book but I quickly lost interest. My <br/>progress is slow. <br/> <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2024/08/msg127864.html Thu, 01 Aug 2024 01:11:22 +0000 Can use Perl and C in a program? (4 messages) How can I implement these two languages of programming in a program? <br/> <br/>What part of the program uses Perl and C? <br/> <br/>Different repositories of Github use many languages of programming in a <br/>project but a program only uses a language of programming. <br/> <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2024/07/msg127861.html Fri, 26 Jul 2024 17:11:46 +0000 First line of input file not accessible. (2 messages) $ uname -a <br/>Darwin Rosie.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:16:51 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T8103 arm64 <br/> <br/>$ locale <br/>LANG=&quot;en_AU.UTF-8&quot; <br/>LC_COLLATE=&quot;en_AU.UTF-8&quot; <br/>LC_CTYPE=&quot;en_AU.UTF-8&quot; <br/>LC_MESSAGES=&quot;en_AU.UTF-8&quot; <br/>LC_MONETARY=&quot;en_AU.UTF-8&quot; <br/>LC_NUMERIC=&quot;en_AU.UTF-8&quot; <br/>LC_TIME=&quot;en_AU.UTF-8&quot; <br/>LC_ALL=&quot;en_AU.UTF-8&rdquo; <br/> <br/>$ perl --version <br/> <br/>This is perl 5, version 34, subversion 3 (v5.34.3) built for darwin-thread-multi-2level <br/> <br/>$ cat print_file <br/>#!/usr/bin/perl -n <br/>while (&lt;&gt;) { <br/> print &quot;$. $_&quot;; <br/>} <br/>exit; <br/> <br/>$ print_file /tmp/orgs2 <br/>2 <br/>3 DevHub CCIDevHub pbw@wise-unicorn-b55zcn.com 00DdM000003155ZUAQ Connected <br/>4 DevHub DevHub pbw@salesforce.dev 00DW2000000afcXMAQ Connected <br/>5 DevHub DevHub2 pbw@nocompany.com 00DdL000000IZqeUAG Connected <br/>6 DevHub LightningAppTest pbw@cunning-goat-fbfy9x.com 00DdM000006N6TaUAK Connected <br/>7 DevHub PackageTestPlayground pbw@curious-unicorn-2ojijy.com 00DdM000005tVl5UAE Connected <br/>8 Scratch 201-3-4 test-0jryu1n6t8jv@example.com 00DFf000000TjmXMAS Active 2024-07-15 <br/>9 Scratch AppTest1-S1 test-bsq9w2vg2kfm@example.com 00DHF000000RGNG2A4 Active 2024-07-18 <br/>10 <br/> <br/>$ wc -l /tmp/orgs2 <br/> 10 /tmp/orgs2 <br/> <br/>$ cat /tmp/orgs2 <br/> Type Alias Username Org ID Status Expires <br/> <br/> DevHub CCIDevHub pbw@wise-unicorn-b55zcn.com 00DdM000003155ZUAQ Connected <br/> DevHub DevHub pbw@salesforce.dev 00DW2000000afcXMAQ Connected <br/> DevHub DevHub2 pbw@nocompany.com 00DdL000000IZqeUAG Connected <br/> DevHub LightningAppTest pbw@cunning-goat-fbfy9x.com 00DdM000006N6TaUAK Connected <br/> DevHub PackageTestPlayground pbw@curious-unicorn-2ojijy.com 00DdM000005tVl5UAE Connected <br/> Scratch 201-3-4 test-0jryu1n6t8jv@example.com 00DFf000000TjmXMAS Active 2024-07-15 <br/> Scratch AppTest1-S1 test-bsq9w2vg2kfm@example.com 00DHF000000RGNG2A4 Active 2024-07-18 <br/> <br/>$ <br/> <br/>What happened to line 1? <br/> <br/>&mdash; <br/>Peter West <br/>pbw@pbw.id.au <br/>`&ldquo;Mary.&rdquo; She turned and said to him in Aramaic, &ldquo;Rabboni!&rdquo;` <br/> <br/> https://www.nntp.perl.org/group/perl.beginners/2024/07/msg127859.html Wed, 17 Jul 2024 07:41:40 +0000 memory (1 message) What consumes major memory in a program of Perl? <br/> <br/> 1. Module <br/> 2. Function <br/> <br/>What algorithms would I use to improve the program? <br/> <br/> <br/> <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2024/07/msg127858.html Thu, 04 Jul 2024 17:07:51 +0000 Re: Perl version 5.8 and 5.10 (1 message) On Sun, Oct 8, 2023 at 5:34&acirc;&#128;&macr;AM armando perez pena &lt;mandyapp2004@msn.com&gt; <br/>wrote: <br/> <br/>&gt; Hello, <br/>&gt; <br/>&gt; What&#39;s the motivation to install a version which is 21 years old ? <br/>&gt; <br/>&gt; If you have an old code probably is better try to update it. <br/>&gt; <br/>&gt; Best Regards, <br/>&gt; Armando <br/>&gt; ------------------------------ <br/>&gt; *From:* Kang-min Liu &lt;gugod@gugod.org&gt; <br/>&gt; *Sent:* Sunday, October 8, 2023 5:32:24 AM <br/>&gt; *To:* beginners@perl.org &lt;beginners@perl.org&gt; <br/>&gt; *Subject:* Re: Perl version 5.8 and 5.10 <br/>&gt; <br/>&gt; &aelig;&#150;&frac14; 2023&aring;&sup1;&acute;10&aelig;&#156;&#136;8&aelig;&#151;&yen; &auml;&cedil;&#138;&aring;&#141;&#136;11:53:46 [GMT+09:00]&iuml;&frac14;&#140;William Torrez Corea &lt; <br/>&gt; willitc9888@gmail.com&gt; &aring;&macr;&laquo;&aring;&#136;&deg;&iuml;&frac14;&#154; <br/>&gt; <br/>&gt; I Tried to install perl version 5.8 and 5.10 with perlbrew but i can&#39;t <br/>&gt; install this version. <br/>&gt; I get the following error message: <br/>&gt; <br/>&gt; 50 tests and 269 subtests skipped. <br/>&gt; make[2]: *** [makefile:701: _test_tty] Error 29 <br/>&gt; make[2]: Leaving directory &#39;perl5/perlbrew/build/perl-5.8.0/perl-5.8.0&#39; <br/>&gt; make[1]: *** [makefile:709: _test] Error 2 <br/>&gt; make[1]: Leaving directory &#39;perl5/perlbrew/build/perl-5.8.0/perl-5.8.0&#39; <br/>&gt; make: *** [makefile:779: test_harness] Error 2 <br/>&gt; ##### Brew Failed ##### <br/>&gt; <br/>&gt; <br/>&gt; <br/>&gt; <br/>&gt; Generally speaking, building old software on a newer system is going to <br/>&gt; yield warnings / errors that are introduced latter then the release of the <br/>&gt; software.... <br/>&gt; <br/>&gt; <br/>&gt; That said, those errors seem to be about unit tests rather than <br/>&gt; comiplation.You may be able to cd into the build dir and still run a `make <br/>&gt; install` to finish the installation, if you are willing to just ignore <br/>&gt; those errors. If those are all the errors in the lot, I imagine that most <br/>&gt; of the perl-5.8.0 would still work. <br/>&gt; <br/>&gt; -- <br/>&gt; Kang-min Liu <br/>&gt; <br/> <br/> <br/>I am coding examples of the book Beginning Perl by Curtis &quot;Ovid&quot; Poe, the <br/>examples use the version Perl 5.8 and Perl 5.10. <br/> <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2024/07/msg127857.html Wed, 03 Jul 2024 23:24:22 +0000 code (1 message) How can I implement an algorithm in my project or source code? <br/> <br/>The majority of the time the algorithm is copied in pseudocode or <br/>mathematically in books or documentation (Greek symbology). <br/> <br/>An equation, operation can code but an algorithm is my weakness; i don&#39;t <br/>the algorithm. <br/> <br/> <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2024/07/msg127856.html Wed, 03 Jul 2024 23:08:12 +0000 algorithms (2 messages) What is the difference between computer algorithms, pseudocode and source <br/>code? <br/> <br/>How can I implement an algorithm in my project or source code? <br/> <br/>The majority of the time the algorithm is copied in pseudocode or <br/>mathematically in books or documentation (Greek symbology). <br/> <br/>An equation, operation can code but an algorithm is my weakness. <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2024/06/msg127854.html Fri, 28 Jun 2024 18:15:24 +0000 regex matching statements (2 messages) Hello list,<br/><br/>are these statements the same in perl?<br/><br/>$ perl -le &#39;$_=&quot;abc&quot;;if (!/\w+\d+/){print &quot;not matched&quot;}&#39;<br/>not matched<br/><br/>$ perl -le &#39;$_=&quot;abc&quot;;if ($_ !~ /\w+\d+/){print &quot;not matched&quot;}&#39;<br/>not matched<br/><br/>or which is the better one?<br/><br/>Thanks.<br/> https://www.nntp.perl.org/group/perl.beginners/2024/06/msg127852.html Wed, 19 Jun 2024 01:55:32 +0000 Easiest Way in Perl to check Whether a Disk is Mounted (6 messages) In unix-like OS&#39;s, there are the mount and mountpoint commands<br/>that can help one determine whether a file system is mounted such<br/>as <br/>$ mount |grep horseradish. <br/>If there is a file system defined in fstab which might look like <br/><br/>UUID=&quot;B159-BB80&quot; /horseradish vfat rw,user,noauto 0 0<br/><br/>and it is not presently mounted, the mount command should not<br/>have any output containing the name horseradish. If the device<br/>with the correct UUID is mounted, the command of mount which<br/>shows all mounted file systems will contain the horseradish line<br/>and also where it is mounted and so forth but the big difference<br/>is that you get a string if /horseradish is mounted and zilch if<br/>it is not.<br/><br/> There is also a unix command of mountpoint which will say<br/>that horseradish, in this case, is not a mount point if it is not<br/>mounted or that it is a mountpoint if it has a FS mounted on it.<br/><br/> The perl script I am working on should check to see if a<br/>device is mounted with the requested name and do one thing if it<br/>is and something else if it is not.<br/><br/> Of course, I can use system calls and call the unix mount<br/>or mountpoint applications but is there a proper perl way to do<br/>this since system calls are not as elegant? Thank you.<br/><br/>Martin McCormick<br/> https://www.nntp.perl.org/group/perl.beginners/2024/06/msg127846.html Sat, 01 Jun 2024 14:25:41 +0000 how to can measure my level of knowledge? (2 messages) I code but my logic is weak, i code 1000 lines of code but I don&#39;t <br/>understand the logic of the program. Can write 10 lines of code, get the <br/>result but I don&#39;t understand the concept. <br/> <br/>Can code the program but I can&#39;t interpret. My mentor told me: understand <br/>the concept because I talk nonsense. <br/> <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2024/05/msg127844.html Thu, 30 May 2024 16:58:59 +0000 crypt (4 messages) &lt;div&gt;&lt;div&gt;&lt;div&gt;Hi.&lt;/div&gt;&lt;div&gt;OpenBSD does not work crypt.&lt;/div&gt;&lt;div&gt;Does it depends on OSes ?&lt;/div&gt;&lt;div&gt;Do you know why I can not use it ?&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;Perl uses the following crypt?&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://man.openbsd.org/crypt&quot; rel=&quot;noopener noreferrer&quot;&gt;https://man.openbsd.org/crypt&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;# My crypt.pl&lt;/div&gt;&lt;div&gt;use strict;&lt;/div&gt;&lt;div&gt;use warnings;&lt;/div&gt;&lt;div&gt;use v5.10;&lt;/div&gt;&lt;div&gt;say crypt(&quot;Ava Max&quot;, &quot;Salt&quot;);&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;FreeBSD works crypt.pl&lt;/div&gt;&lt;div&gt;% perl -v&lt;/div&gt;&lt;div&gt;This is perl 5, version 36, subversion 3 (v5.36.3) built for amd64-freebsd-thread-multi&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;% perl crypt.pl&lt;/div&gt;&lt;div&gt;Sasi0YO57eKNE&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;OpenBSD does not works crypt.pl&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;OpenBSD$ perl -v&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;This is perl 5, version 36, subversion 3 (v5.36.3) built for amd64-openbsd&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;OpenBSD$ perl crypt.pl&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&lt;/div&gt;&lt;div&gt;Use of uninitialized value in say at crypt.pl line 4.&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;OpenBSD$&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;I got a empty line. As it didn&#39;t work, I installed perl from source code.&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;&lt;a href=&quot;https://www.cpan.org/src/README.html&quot; rel=&quot;noopener noreferrer&quot;&gt;https://www.cpan.org/src/README.html&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;OpenBSD$ /home/masayoshi/localperl/bin/perl -v&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;This is perl 5, version 38, subversion 2 (v5.38.2) built for OpenBSD.amd64-openbsd&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;OpenBSD$ /home/masayoshi/localperl/bin/perl crypt.pl &nbsp;&lt;/div&gt;&lt;div&gt;Use of uninitialized value in say at crypt.pl line 4.&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;div&gt;OpenBSD$&lt;/div&gt;&lt;div&gt;&nbsp;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt; https://www.nntp.perl.org/group/perl.beginners/2024/05/msg127840.html Sat, 25 May 2024 08:59:47 +0000 project (2 messages) What is the need to develop a project in Perl? <br/> <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2024/05/msg127838.html Sat, 18 May 2024 01:42:33 +0000 module dependency (4 messages) greetings everybody, <br/> <br/>How do I know which other modules are required by the perl module (like Net::SMTPS) I am using? <br/> <br/>Thanks <br/> https://www.nntp.perl.org/group/perl.beginners/2024/05/msg127834.html Thu, 16 May 2024 13:07:42 +0000 stage of programming (2 messages) A client need a project in PHP and Java but i only can program in Perl <br/> <br/>What would I make? <br/>What part of the project can use Perl? <br/>Can Perl be 100% of my project? <br/> <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2024/05/msg127832.html Tue, 14 May 2024 21:30:07 +0000 lines of code for code a website (3 messages) How many lines of code are needed to code a website? <br/> <br/>*in c, java, php and perl * <br/> <br/>What language is ideal for this task? <br/> <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2024/05/msg127829.html Fri, 03 May 2024 06:27:49 +0000 [announcements mailing list] (4 messages) Dear all, <br/> <br/>How are you? I hope all is well with you. I&rsquo;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 developments, when a new version of Perl will be available or released? It would be nice and pleasant to know. Thank you and have a wonderful Friday ahead! <br/> <br/>&mdash; <br/>Best wishes, <br/>Maxim <br/> <br/>Maxim Abalenkov \\ maxim.abalenkov@gmail.com <br/>+44 7 486 486 505 \\ www.maxim.abalenkov.uk https://www.nntp.perl.org/group/perl.beginners/2024/03/msg127825.html Fri, 15 Mar 2024 11:27:45 +0000 Upgrade from Debian 11 to Debian 12 Broke Perl. (4 messages) I am asking this to hold collateral damage to a minimum, collateral <br/>damage in this case being all the stupid things we do when stuff <br/>breaks and documentation isn&#39;t clear about what is the shortest <br/>and safest path to restore functionality. <br/> <br/> I upgraded a debian bullseye system to debian bookworm <br/>which is not what this list is about and everything else worked <br/>as advertised except perl which is totally broken right now. <br/> <br/>After using perl for about ten years, it has become my goto <br/>solution for many varied projects such as controlling radio <br/>scanners that have RS-232 style interfaces and for munching text <br/>from all kinds of outputs so that the text fits some other <br/>purpose that nobody else cares about but solves the problem at hand. <br/> <br/> There&#39;s even an app I wrote to hangup on telemarketers <br/>and scammers which has collected about 460 pillars of the <br/>community that like to make junk phone calls at dinner time. <br/> <br/> I installed cpanplus with apt in debian and went from <br/>there, with cpanplus being the only perl package I got from the <br/>debian repository. <br/>All other perl modules have been installed over time using <br/>that cpanplus application as in <br/>cpanp -i [module name]. <br/> <br/> After upgrading from debian 11 (bullseye) to debian 12 <br/>(bookworm), the world changed and everything perl broke. <br/> <br/> My hope is to get perl back with a minimum of redundant <br/>work. <br/> <br/> I found documentation about how to install perl on a <br/>new debian bookworm system but little to none on how to move an <br/>existing installation to the new world which makes me wonder what <br/>went wrong. <br/> <br/> The output of the present perl -v command follows: <br/> <br/>This is perl 5, version 36, subversion 0 (v5.36.0) built for x86_64-linux-gnu-thread-multi <br/>(with 53 registered patches, see perl -V for more detail) <br/> <br/>Copyright 1987-2022, Larry Wall <br/> <br/>Perl may be copied only under the terms of either the Artistic License or the <br/>GNU General Public License, which may be found in the Perl 5 source kit. <br/> <br/>Complete documentation for Perl, including FAQ lists, should be found on <br/>this system using &quot;man perl&quot; or &quot;perldoc perl&quot;. If you have access to the <br/>Internet, point your browser at https://www.perl.org/, the Perl Home Page. <br/> <br/> If I run any perl applications, all break with error <br/>squawks regarding the first module in that particular app that <br/>can not be located. <br/> <br/> The app I wrote to control radio scanners is named p2 so <br/> <br/>$ p2 sts <br/> <br/>should produce the radio&#39;s status and did until the upgrade. <br/>Now, it sends <br/> <br/>Can&#39;t locate warnings/unused.pm in @INC (you may need to install the warnings::unused module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.36.0 /usr/local/share/perl/5.36.0 /usr/lib/x86_64-linux-gnu/perl5/5.36 /usr/share/perl5 /usr/lib/x86_64-linux-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. <br/>BEGIN failed--compilation aborted at /home/martin/etc/p2 line 3. <br/> <br/>So, if I try to use cpanp and re-add that module, I get: <br/> <br/>1wb5agz martin tmp $ cpanp -i Warnings::Unused <br/>ERROR] &#39;Warnings::Unused&#39; does not contain an author part <br/> <br/>[ERROR] Cannot find &#39;Warnings::Unused&#39; in the module tree <br/> <br/>No such module: Warnings::Unused <br/>No modules found to operate on! <br/>Nothing done <br/> <br/> That is obviously all balderdash but somewhere, there is <br/>the correct module tree and when one runs the app in question, it <br/>probably still works. <br/> <br/> If I try to use debian&#39;s apt package manager to upgrade <br/>cpanpplus, it tells me that what is there is the most recent <br/>version. <br/> <br/> I did find a source package to bring perl 5.36.1 on to a <br/>debian12 system. It compiled, installed and ran with no <br/>complaints at all but it&#39;s not a debian package which means that <br/>if one goes that route, one will always have to watch upgrades <br/>since it is a third-party package. <br/> <br/> It did show up when running perl -version and in attempts <br/>to use it but the missing modules and other general <br/>disfunctionality carried over so I uninstalled it so that we are <br/>back to where we started. <br/> <br/> I either did something very wrong a long time ago which <br/>has now cought up with me or I am missing something about the <br/>upgrade process that only broke perl as far as I know. <br/> <br/> Thanks for any constructive ideas for getting perl back. <br/> <br/>Martin McCormick <br/> https://www.nntp.perl.org/group/perl.beginners/2024/03/msg127821.html Mon, 11 Mar 2024 17:51:41 +0000 [install and use local::lib module] (4 messages) Dear all, <br/> <br/>How are you? I hope all is well with you. I need help please. I recently moved to a new laptop and installed Perl 5.38.2 from source. I would like to discipline myself and learn how to use the &lsquo;local::lib&rsquo; module properly. I downloaded the source code of local::lib from cpan website and installed it with: <br/> <br/> perl Makefile.PL &mdash;bootstrap <br/> make install <br/> <br/>It installed correctly. However, when I try to use this module in my script with: <br/> <br/> use local::lib <br/> <br/>My program crashes with the following error message: <br/> <br/>Can&#39;t locate local/lib.pm in @INC (you may need to install the local::lib module) (@INC entries checked: /Users/mabalenk/.cpan /usr/local/lib/perl5/site_perl/5.38.2/darwin-thread-multi-2level /usr/local/lib/perl5/site_perl/5.38.2 /usr/local/lib/perl5/5.38.2/darwin-thread-multi-2level /usr/local/lib/perl5/5.38.2) at /Users/mabalenk/bin/upg-macports.pl line 14. <br/>BEGIN failed--compilation aborted at /Users/mabalenk/bin/upg-macports.pl line 14. <br/> <br/>These are the environment variables that I set in my .profile file: <br/> <br/> # Perl 5.38 <br/> export PATH=/usr/local/bin:$PATH <br/> export PERL5LIB=$HOME/.cpan <br/> <br/>I can see the &ldquo;local::lib&rdquo; files with: <br/> <br/>find .cpan -name &quot;local&quot; <br/>.cpan/build/local-lib-2.000029-2/blib/arch/auto/local <br/>.cpan/build/local-lib-2.000029-2/blib/lib/POD2/PT_BR/local <br/>.cpan/build/local-lib-2.000029-2/blib/lib/POD2/DE/local <br/>.cpan/build/local-lib-2.000029-2/blib/lib/auto/local <br/>.cpan/build/local-lib-2.000029-2/blib/lib/local <br/>.cpan/build/local-lib-2.000029-2/lib/POD2/PT_BR/local <br/>.cpan/build/local-lib-2.000029-2/lib/POD2/DE/local <br/>.cpan/build/local-lib-2.000029-2/lib/local <br/>.cpan/build/local-lib-2.000029-1/blib/arch/auto/local <br/>.cpan/build/local-lib-2.000029-1/blib/lib/POD2/PT_BR/local <br/>.cpan/build/local-lib-2.000029-1/blib/lib/POD2/DE/local <br/>.cpan/build/local-lib-2.000029-1/blib/lib/auto/local <br/>.cpan/build/local-lib-2.000029-1/blib/lib/local <br/>.cpan/build/local-lib-2.000029-1/lib/POD2/PT_BR/local <br/>.cpan/build/local-lib-2.000029-1/lib/POD2/DE/local <br/>.cpan/build/local-lib-2.000029-1/lib/local <br/>.cpan/build/local-lib-2.000029-0/blib/arch/auto/local <br/>.cpan/build/local-lib-2.000029-0/blib/lib/POD2/PT_BR/local <br/>.cpan/build/local-lib-2.000029-0/blib/lib/POD2/DE/local <br/>.cpan/build/local-lib-2.000029-0/blib/lib/auto/local <br/>.cpan/build/local-lib-2.000029-0/blib/lib/local <br/>.cpan/build/local-lib-2.000029-0/lib/POD2/PT_BR/local <br/>.cpan/build/local-lib-2.000029-0/lib/POD2/DE/local <br/>.cpan/build/local-lib-2.000029-0/lib/local <br/> <br/>But they are in the &ldquo;build&rdquo; directory. This is a little bit suspicious. Am I missing some installation steps? Would you please help me to install &ldquo;local::lib&rdquo; correctly? Thank you very much and have a wonderful day ahead! <br/> <br/>&mdash; <br/>Best wishes, <br/>Maxim <br/> <br/>Maxim Abalenkov \\ maxim.abalenkov@gmail.com <br/>+44 7 486 486 505 \\ www.maxim.abalenkov.uk https://www.nntp.perl.org/group/perl.beginners/2024/02/msg127817.html Thu, 15 Feb 2024 10:12:17 +0000 Are there any ALSA Perl Modules? (7 messages) Several years ago, I wrote some C code which turns one&#39;s<br/>computer&#39;s sound interface in to a sound-activated recorder that<br/>I could then connect to radio receivers or microphones and record<br/>when audio started and stop recording when there is nothing but<br/>silence. One essentially sets a sound card to record<br/>continuously but the sound samples go through code that knows<br/>what silence looks like. In short, silence looks like samples<br/>whose numeric value is exactly half-way between the lowest and<br/>highest voltage that the analog-to-digital converter reads,<br/>commonly either 32,767 representing silence, give or take a count<br/>or two due to digital sampling errors or decimal 128, hex 80 for<br/>8-bit mono audio.<br/><br/> The Advanced Linux Sound Architecture Project has C library<br/>functions for setting sample rates, mono, stereo, big or little<br/>endianness and 8 or 16-bit audio, whatever one needs for their<br/>application. One can even define samples as signed or unsigned<br/>integers.<br/><br/> Once one gets a stream of ints which are usually 32-bits<br/>wide for stereo or 16-bit shorts for mono, the sound processing<br/>can begin which C is really good at but perl is just as good at<br/>so if one could get the same alsa modules which are used by aplay<br/>and arecord for setting up one&#39;s audio interfaces or sound cards,<br/>the manipulation of those data that was done in C could also be<br/>done in perl without hardly any modification to it at all.<br/><br/> Perl has just the right mix of low-level logic and<br/>bitwise operators plus a much more easy-to-use string handling<br/>capability which is why I am asking this question.<br/><br/> I may be looking in the wrong places but, so far, I seem<br/>to be batting zeros when looking for perl and alsa together.<br/><br/> Any good ideas are greatly appreciated, here.<br/><br/> Martin McCormick<br/> https://www.nntp.perl.org/group/perl.beginners/2024/01/msg127804.html Sun, 28 Jan 2024 19:27:54 +0000 https://metacpan.org/pod/OpenOffice::OODoc (9 messages) Hi, <br/> <br/>is there a way to create libreoffice spreadsheets (ods) similar to <br/>Excel::Writer::XLSX? <br/> <br/>There is OpenOffice::OODoc and I don&#39;t see how to create spreadsheet <br/>documents with that. <br/> <br/>Is there still no way to do that? <br/> <br/> https://www.nntp.perl.org/group/perl.beginners/2024/01/msg127801.html Thu, 25 Jan 2024 19:05:24 +0000 regex (14 messages) Please help me to understand this:<br/>$ perl -e &#39;exit(10) if &quot;aaa&quot;=~/a{,2}/;&#39;<br/>$ echo $?<br/>$ 10<br/><br/>Thanks<br/><br/>Jorge Almeida<br/> https://www.nntp.perl.org/group/perl.beginners/2024/01/msg127787.html Mon, 22 Jan 2024 12:23:45 +0000 Using UNIX domain sockets (3 messages) Hi,<br/><br/>I am trying to control mpv player using unix sockets but it looks like <br/>that perl is unable to send the string correctly.<br/><br/>I run the following command:<br/>mpv --input-ipc-server=~/mpv.sock --idle=yes -v -v<br/><br/>If I sent the string using system commands:<br/><br/>$ echo &#39;{&quot;command&quot;:[&quot;stop&quot;]}&#39; | socat - ~/mpv.sock | jq<br/>{<br/> &quot;data&quot;: null,<br/> &quot;request_id&quot;: 0,<br/> &quot;error&quot;: &quot;success&quot;<br/>}<br/><br/>It works as expected and is accepted by mpv:<br/>[ipc_1] Client connected<br/>[cplayer] Run command: stop, flags=64, args=[flags=&quot;&quot;]<br/>[ipc_1] Client disconnected<br/><br/><br/>Now I run this perl code:<br/><br/>#!/usr/bin/perl<br/>use strict;<br/>use warnings;<br/>use IO::Socket::UNIX;<br/><br/>my $mpv_socket = IO::Socket::UNIX-&gt;new(<br/> Type =&gt; SOCK_STREAM(),<br/> Peer =&gt; &quot;$ENV{HOME}/mpv.sock&quot;,<br/>) or die &quot;socket failed: &quot;,$!,&quot;\n&quot;;<br/><br/>my $cmd=&#39;{&quot;command&quot;:[&quot;stop&quot;]}&#39;;<br/>$mpv_socket-&gt;send($cmd);<br/><br/>and it fails to send the correct text:<br/>[ipc_2] Client connected<br/>[ipc_2] Client disconnected<br/>[ipc_2] Ignoring unterminated command on disconnect.<br/><br/>the message &quot;Ignoring unterminated command on disconnect&quot; is because the <br/>text sent does not seem to be correct and is ignored by mpv.<br/><br/>For what reason could it be that the text sent does not end correctly?<br/> https://www.nntp.perl.org/group/perl.beginners/2024/01/msg127784.html Mon, 15 Jan 2024 19:25:50 +0000 lambda array (5 messages) Hi, <br/> <br/>how do I pass an array that is created on the fly as one parameter of <br/>a function? <br/> <br/>Example: <br/> <br/> <br/>use feature &#39;signatures&#39;; <br/>no warnings &#39;experimental::signatures&#39;; <br/> <br/>sub reply_multi ( $xmpp_o, $rcpts, $msg ) { <br/> foreach my $rcpt (@$rcpts) { <br/> $$xmpp_o-&gt;MessageSend( type =&gt; &#39;chat&#39;, to =&gt; $rcpt, body =&gt; $msg ); <br/> } <br/> <br/> return; <br/>} <br/> <br/>reply_multi( \$daemon{xmpp_o}, \($adminuser{fromJID}, $fromJID), &quot;blah&quot; ); <br/> <br/> <br/>This gives me an error at runtime: &quot;Too many arguments for subroutine <br/>&#39;main::reply_multi&#39; (got 4; expected 3)&quot;. <br/> <br/>Yeah, sure, ok, but is that even right? Or is signatures too <br/>experimental to handel that yet? Or how do I do what I want here? <br/> <br/> https://www.nntp.perl.org/group/perl.beginners/2024/01/msg127772.html Sat, 13 Jan 2024 14:51:24 +0000 How to reboot? (12 messages) Hi, <br/> <br/>I would like to write a program (daemon) which will be automatically <br/>started by systemd at boot which will allow me to reboot or restart my <br/>computer through commands sent via xmpp. The xmpp part (xmpp client) <br/>and starting that program is no problem. <br/> <br/>But how can I reboot/restart the computer from the xmpp client? I <br/>don&#39;t want the xmpp client to run as root all the time. I would use <br/>something like <br/> <br/> <br/>system(&#39;shutdown&#39;, &#39;-r&#39;, &#39;now&#39;); <br/> <br/> <br/>in the xmpp client, and that does require root privileges. To make <br/>things more complicated, systemd will probably interfere in some ways, <br/>and selinux also may get in the way. So how I can do that? <br/> <br/> <br/>The background is that some idiots have decided that pressing <br/>Ctrl+Alt+Del doesn&#39;t reboot the computer anymore but, at best, <br/>restarts after 60 seconds if I&#39;m logged in to a gnome session or, if <br/>I&#39;m not logged in --- like when the screen saver logged me out --- it <br/>does nothing. It doesn&#39;t seem to work when I&#39;m on the console, <br/>either. <br/> <br/>That totally sucks when the display remains black and doesn&#39;t come <br/>back no matter what you do. In such cases, I still want to be able to <br/>reboot or to shutdown the computer instead of having to hold the power <br/>button until it turns off, and without pressing the reset button. <br/> <br/>Preferably, I&#39;d like to get Ctrl+Alt+Del to work again like it should, <br/>but that&#39;s probably something we can only dream of these days :( <br/> <br/> https://www.nntp.perl.org/group/perl.beginners/2024/01/msg127767.html Fri, 12 Jan 2024 13:16:48 +0000 Re: Knowledge for a basic programmer and advanced programmer (5 messages) On Sat, 16 Dec 2023 08:10:49 -0600 <br/>William Torrez Corea &lt;willitc9888@gmail.com&gt; wrote: <br/> <br/>&gt; What needs to know a basic and advanced programmer? <br/>&gt; <br/>&gt; I am a basic programmer, I don&#39;t have enough experience to be an advanced <br/>&gt; programmer. <br/>&gt; <br/>&gt; How many years of experience must an advanced programmer have? <br/>&gt; <br/> <br/>hi William, <br/> <br/>I answered many of your questions in the FAQs I comaint. List here: <br/> <br/>https://www.shlomifish.org/meta/FAQ/which_faqs_do_you_comaint.xhtml <br/> <br/>-- <br/> <br/>Shlomi Fish https://www.shlomifish.org/ <br/>Parody of &quot;The Fountainhead&quot; - https://shlom.in/towtf <br/> <br/>Golden rule #12: When the comments do not match the code, they probably are <br/>both wrong. ;) &mdash; Steven Rostedt, https://lwn.net/Articles/433900/ <br/> <br/>Please reply to list if it&#39;s a mailing list post - https://shlom.in/reply . <br/> https://www.nntp.perl.org/group/perl.beginners/2024/01/msg127759.html Tue, 02 Jan 2024 11:17:24 +0000 Re: How to identify a scam of a contribution? (1 message) On Fri, Dec 29, 2023, 2:54 PM William Torrez Corea &lt;willitc9888@gmail.com&gt; <br/>wrote: <br/> <br/>&gt; *How do you work?* <br/>&gt; <br/>&gt; I received a message on my social network from one account in Awka City of <br/>&gt; Nigeria. <br/>&gt; <br/>&gt; The account is not verified and post spam in your account <br/>&gt; <br/>&gt; The website is *phishing*: <br/>&gt; <br/>&gt; <br/>&gt; https://www.virustotal.com/gui/url/fa9e13783067e995e05672fd1c8bb8593f90fbc8d128a76bae67e976a5292068?nocache=1 <br/>&gt; <br/>&gt; The message with job offer: <br/>&gt; -- <br/>&gt; <br/>&gt; With kindest regards, William. <br/>&gt; <br/>&gt; &acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&gt; &acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&gt; &acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&gt; &acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/>&gt; <br/>&gt; <br/>&gt; <br/> https://www.nntp.perl.org/group/perl.beginners/2023/12/msg127757.html Fri, 29 Dec 2023 21:42:46 +0000 [getting PAUSE account] (9 messages) Dear all, <br/> <br/>How are you? I hope all is well with you. I&rsquo;m reading the &lsquo;Intermediate Perl&rsquo; textbook. It suggests applying for a PAUSE account. I applied a couple of days ago using the link listed in the book. However, I still haven&rsquo;t received any reply. Am I doing something wrong? Shall I be more patient or is the advice in the book no longer relevant? Please let me know. Thank you and have a good day ahead! <br/> <br/>-- <br/>Best wishes, <br/>Maxim <br/> <br/>Maxim Abalenkov \\ maxim.abalenkov@gmail.com <br/>+44 7 486 486 505 \\ www.maxim.abalenkov.uk https://www.nntp.perl.org/group/perl.beginners/2023/12/msg127752.html Sat, 23 Dec 2023 16:01:27 +0000 Knowledge for a basic programmer and advanced programmer (1 message) What needs to know a basic and advanced programmer? <br/> <br/>I am a basic programmer, I don&#39;t have enough experience to be an advanced <br/>programmer. <br/> <br/>How many years of experience must an advanced programmer have? <br/> <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2023/12/msg127751.html Sat, 16 Dec 2023 14:11:05 +0000 perlbrew (2 messages) Try to change the version of my Perl but not change. <br/> <br/>I have Perl v5.36.1, I tried to change Perl to Perl v5.10.0 but I didn&#39;t <br/>get the desired effect. <br/> <br/>I have the following error: <br/> <br/>A sub-shell is launched with perl-5.10.0 as the activated perl. Run &#39;exit&#39; <br/>&gt; to finish it. <br/>&gt; <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2023/11/msg127748.html Wed, 22 Nov 2023 21:14:59 +0000 Perl Design Patterns (2 messages) When must I use perl design patterns? <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2023/11/msg127744.html Sat, 18 Nov 2023 15:49:17 +0000 Program complete (1 message) *What is a complete program or what needs a program to be complete?* <br/> <br/>Is a different a program of C in comparison with a program in Perl. In C <br/>the program has a structure but in Perl it is different. <br/> <br/>my @numbers = (3,7,9,99,25); <br/>&gt; my @perfect_squares; <br/>&gt; <br/>&gt; # the next statement is useful when you want to skip the processing <br/>&gt; # of some elements. You can use this to rewrite the previous code <br/>&gt; # to find all perfect squares in a loop <br/>&gt; for my $number (@numbers){ <br/>&gt; my $root = sqrt ($number); <br/>&gt; <br/>&gt; if (int ($root) != $root){ <br/>&gt; next; #skip the rest of the loop BLOCK <br/>&gt; } <br/>&gt; <br/>&gt; print &quot;Found perfect square: $number\n&quot;; <br/>&gt; push @perfect_squares, $number; <br/>&gt; } <br/>&gt; ~ <br/>&gt; <br/>&gt; ~ <br/>&gt; <br/> <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2023/11/msg127743.html Wed, 15 Nov 2023 06:17:02 +0000 Over-productive or improductive (1 message) What is the best option for work in software development? <br/> <br/> <br/>*My weak * <br/> <br/> 1. I am <br/>*over-productive * <br/> 2. I have impostor syndrome <br/> 3. I have burnout <br/> 4. My learning curve is slow <br/> <br/> <br/> <br/> <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2023/11/msg127742.html Mon, 06 Nov 2023 22:32:15 +0000 Software engineering (1 message) What happens if I use only perl for developing a program? <br/>What problems can come up? <br/> <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2023/11/msg127741.html Sat, 04 Nov 2023 03:49:13 +0000 Developer Skills Report (1 message) In my country there are no developer skills reports, I read developer <br/>skills reports from the USA and Europe. <br/> <br/>Only know: the developers use Java, .Net, SQL Server, frameworks and the <br/>requirements of each company but there does not exist a direction. Some <br/>developers appeal to remote work, others maintain software and others <br/>create their own company. <br/> <br/>Nobody uses Perl in my country for development, maybe for personal projects <br/>or tasks of the university but the working market does not demand this <br/>language. <br/>-- <br/> <br/>With kindest regards, William. <br/> <br/>&acirc;&cent;&#128;&acirc;&pound;&acute;&acirc;&nbsp;&frac34;&acirc;&nbsp;&raquo;&acirc;&cent;&para;&acirc;&pound;&brvbar;&acirc;&nbsp;&#128; <br/>&acirc;&pound;&frac34;&acirc;&nbsp;&#129;&acirc;&cent;&nbsp;&acirc;&nbsp;&#146;&acirc;&nbsp;&#128;&acirc;&pound;&iquest;&acirc;&iexcl;&#129; Debian - The universal operating system <br/>&acirc;&cent;&iquest;&acirc;&iexcl;&#132;&acirc;&nbsp;&#152;&acirc;&nbsp;&middot;&acirc;&nbsp;&#154;&acirc;&nbsp;&#139;&acirc;&nbsp;&#128; https://www.debian.org <br/>&acirc;&nbsp;&#136;&acirc;&nbsp;&sup3;&acirc;&pound;&#132;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128;&acirc;&nbsp;&#128; <br/> https://www.nntp.perl.org/group/perl.beginners/2023/11/msg127740.html Wed, 01 Nov 2023 21:18:03 +0000