I had been perusing the perlguts documents and there is a strong warning against allocating memory with eg alloc for use in C code that interfaces with Perl suggesting that buffers be allocated with Newxs (or equivalent) even if they don't leave the guts. What is the base of this statement?
I am trying to understand whether conflicts would arise the way memory is managed through the MMUs working with the OS nowadays. Theoretically it shouldn't lead to any issues as the OS would not release memory that has been allocated before (even it has not been mapped by the process). Unless one were to deallocate memory using facilities different than the one used to allocate the memory in the first place one should be OK to mix allocators as they have different performance for different patterns of memory use? Am I missing something?
submitted by /u/ReplacementSlight413
[link] [comments]
Sounds pretty good, version 42.
github.com/Perl/PPCs/blob/main…
submitted by /u/Ok-Captain-6460
[link] [comments]
Hey guys! Im completely new to the community and know nothing of Perl, im a third year student of Software Engineer and I chose to write an essay (about 10 pages) about this exciting programming language. Id love to get some help as I am completely lost. What are some main points that I cant miss? What is Perl most used for professionally? What are some similar languages and what are the key differences between them? Any of this helps or if anyone has any ideas, im lost here! Its due like next week, no big rush
submitted by /u/Lete_Salas
[link] [comments]
I read the man page and I tried searching, but either my search skills have significantly deteriorated or search engines have, because I have trouble now finding any technical answers on google/etc regardless of the question.
With MakeMaker, one can set the CFLAGS with OPTIMIZE="whatever"
as an environmental variable when running perl Makefile.PL
It then gets put in the generated Makefile
With perl Build.PL
which does not use make
I can not figure out how to do the equivalent.
It must be simple, I just can't find it.
Thank you for suggestions.
submitted by /u/AnymooseProphet
[link] [comments]
I decided to open an account here after seeing so many posts, all with the same characteristics:
- Corinna is great
- It will happen
- This post is at least 3 years old
What’s going on? Why is implementation so slow? What can be done to help?
I see many discussions and many people holding things back with condescending arguments and fear of change. It’s clear (and if it’s not clear to the kind reader, then I think there’s a problem with you) that Perl is in trouble and dying from a lack of new developers. One of the main reasons is the absence of a decent object system, and a native one, not a module.
So much has been said about Corinna, so much work has been done, and yes, it’s great as it is, but it’s experimental. Over the past year, we’ve gained what — new writers? Where’s everything that was planned? Destruct blocks, custom constructors, custom readers and writers, :common, etc.
To make it popular, we need it. We need more people using it, and for that, we need it in the language — not as an experimental feature. So much time has been invested in decision-making, but no language is perfect. We just need it. It doesn’t have to be perfect.
submitted by /u/RegexSorcerer
[link] [comments]
TL:DR I'm in the process of writing a 'long now' document packing system, built to convey my and my descendants digital family archives into 24nd century(1). Looking at IT history I see that I can't rely an most things 'being there' in the decades to come, developers come and go, communities disperse, operating systems and CPU architectures change so old binarys have to be nursed along with emulators (Things fall apart; the CentOS cannot hold...). Taking a really pessimistic view I think only ASCII(+UTF-8) and HTML made of basic paragraph, tables and hyperlinks to be so deeply embedded that future software will need to be backwards compatible (and failing that can be simply be converted to UTF-64).
So I'm looking for a minimal Perl source code distribution that someone in the after the Death of Perl (Film at 11) can compile to extend the life of my codebase without having to rewrite it.
Longer version
I'm trying to minimize dependency's by writing scripts that build a ultrabasic static HTML website accessible via webserver, filesystem (and future AI). As a simple website it can be copied to archive.org as another strand of preservation (though storing it as a .zip, the wayback machine does bad things to the underlying structure of stored websites).
I'm working on the base assumption that my descendants will be non technical folk, able to run the command line file import and site building scripts with little understanding of how they work or how to maintain them. So I have a site built from data in easily editable textfile and the Perl code to use a minimum of CPAN modules. One day Perl may fall out of use(2), on that dark day they won't be able to update the collections, but since it's all HTML everything remains accessible and easy to copy forwards
However what I can do is throw a bone to a geeky decedent (or paid developer). So I document the system and surround the import and building scrips with a test framework so they can replicate it in their own pet language. I can also help by adding minimal a Perl source code distribution (and make sure the few modules I use are written in pure Perl and work with it). So when we see the end of ARM/IBM they could go for a recompile rather than a rewrite.
PS the obvious answer is pack it in Docker or the like, which has two problems 1) Docker et al isn't stable in the 'long now' 2) I'm aiming at a demographic who are only able to run a command line (that has been written down for them), copy a file system and can't be bothered to work out how to set up Docker.
(1) this is hubris, but I know for a fact that if I do nothing everything is certain to end up in /dev/null
(2) so could Python3 (botching it's jump from 3 to 4 in the same way it botched 2 to 3), or any language could fall by the wayside. How long will COBOL hang on in banking?
submitted by /u/octobod
[link] [comments]
This has been in the works for a while, but now is a good time to leave comments on the changes: github.com/Perl-Critic/PPI/pul…
submitted by /u/oalders
[link] [comments]
I just uploaded a video I'm calling "You've been lied to about PERL" that I was hoping to get feedback on. I'm not sure if I'm going to leave it on youtube - I'll probably either replace it with a v2, or make it available as paid content when I do somewhere. Either way, it's intended as a crash-course for people who are either coming from shell scripting, or know another programming language, so I go quick, and I don't cover everything.
I think the video is a success if it gets people curious about perl, so I wasn't necessarily shooting for the most polished thing in the world. That said, if there's something critical I didn't include, or any feedback you have, I'd love to hear it. It's about a 90 minute course, so you might want to skip around, or 2x the speed, or who knows put it on in the background as ASMR.
Here's the link: youtu.be/TDV2ACy-oaU
submitted by /u/nickbernstein
[link] [comments]
I need to test my module on i686 Perl without 64bit ints. I turned up an old Raspberry Pi 1 with a 32bit OS and even that has support for 64bit ints. How far back do I have to go to get something I can test against like I'm seeing in my CPAN testers failures?
Or is that such an uncommon configuration that I shouldn't even worry about it?
submitted by /u/scottchiefbaker
[link] [comments]
I'm starting my journey from Catalyst to Mojo and it's interesting so far. I've been using Catalyst for over a decade, so I expect I have some bad habits to resolve. My question is:
Is there a way to get a Catalyst DBIx-like model in Mojo? I like the model structure used in Catalyst, I like the way it allows me to create a really easy to understand data layer for my projects. I prefer it to the more direct, access the tables/DB directly with queries approach. Is there a Mojo equivalent to the Catalyst
MyApp_create model MainDB.....
available for mojo? Thanks!
submitted by /u/conicalanamorphosis
[link] [comments]
My wife and have a hobby-level online radio station and we use Logitech Media Server as the backend. As part of what we use we're running a plug-in called Spicefly Sugarcube, which interacts with a "brain" called MusicIP. MusicIP allows music suggestions to be called using an API, which is basically what Sugarcube is doing, and it builds a URL with the very last element being "recipe," which is a filter built into MusicIP that helps shape the direction the songs go.
The issue is I'd like to replace the recipe section of this plug in with a fixed array that cycles through to emulate a radio format clock. I realize that by doing this under the hood I lose the functionality of changing the recipes on the fly, but that's okay.
The program is driven by the
plugin.pm
file located here:
bitbucket.org/spicefly/sugarcu…
I know nothing about Perl so tried to have ChatGPT alter this to replace the recipe section with a fixed array, It returned the upper part of the file this way, with no other changes, and the plug in won't load like this:
#v6.01 - December 2023
#+===================+
#Licencing Requirements Removed
#Released as Open Source under the GNU General Public License v3.0
#
#In Short Summary
#Complete source code must be made available that includes all changes
#Copyright and license notices must be preserved.
#Contributors provide an express grant of patent rights.
package Plugins::SugarCube::Plugin;
# Define the recipe sequence array
my
u/recipe_sequence = ('5s', '4s', '5s', '5s', '4s', '5s', '4s', '5s', '5s', '4s', '5s', '4s', '5s', '5s', '4s', '5s', '5s', '4s');
my $recipe_index = 0;
# Function to get the next recipe in sequence
sub get_next_recipe {
my $recipe = $recipe_sequence[$recipe_index];
$recipe_index = ($recipe_index + 1) %
u/recipe_sequence; # Loop back to the start
return $recipe;
}
use base qw(Slim::Plugin::Base);
use strict;
use Slim::Utils::Misc;
use Slim::Utils::Prefs;
use Slim::Utils::Log;
my $log = Slim::Utils::Log->addLogCategory(
{
'category' => 'plugin.sugarcube',
# 'defaultLevel' => 'WARN',
'defaultLevel' => 'DEBUG',
'description' => getDisplayName(),
}
);
So my question is, is this possible, and is the kernel of how to make it work here, or is there a better way to do it? If you look at the original plugin.pm file you'll see how the URL is built, and I really just want the very end of the URL to be &recipe=5s or %recipe=4s depending on the sequence I enter. Any help it appreciated!
submitted by /u/typecrazy789
[link] [comments]
I've been trying to port a couple of GUI programs I have from Tkx to Prima in order to get free from ActiveState's shenaningans. I have succesfully translated part of my GUIs to Prima, but I have a lot of trouble with layout.
I don't see a simple way to do what I want, which is to have several rows of controls (buttons at the top and bottom, and a TextView or Edit control in the middle) without it turning into a mess.
I was using frames in Tkx, which are like invisible containers for controls, but Prima doesn't seem to have an equivalent. There are GroupBoxes which always include a border and legend, and FrameSets which always display a border and seem to always be resizable.
I haven't found any comprehensive documentation on any of these, and in particular, the example program for frames shows the use of some exotic properties that don't seem to be documented anywhere.
I'd be grateful if someone could point me to any posts, tutorials, or documentation about frames or whatever I can use as a container for buttons and controls.
submitted by /u/elbitjusticiero
[link] [comments]
I'm attempting to port this C hashing function to Perl but it's not working:
c static inline uint64_t hash64(uint64_t val, unsigned bits) { return (val * 0x61c8864680b583ebull) >> (64 - bits); }
Here is what I came up with:
``` sub hash64 { my ($val, $bits) = @_; my $magic_constant = 0x61c8864680b583eb;
# Perform the hash computation my $hashed = ($val * $magic_constant) >> (64 - $bits); return $hashed;
} ```
My hashed values aren't matching what I'm seeing from C. I suspect it has to do with how Perl handles numbers larger than 64bit? C would truncate them (I think) but Perl will happily work with larger numbers?
12345 hashed to 64bits should output 6832837858993532755 according to the C version. Am I missing something obvious?
submitted by /u/scottchiefbaker
[link] [comments]
Hi, I am installing braker and it requires a set of Perl modules to be installed. I am having a hard time installing the YAML::XS module. I am using Perl v5.38.
The Perl module was installed using cpanm
command, and when I run perldoc -l YAML::XS
it shows There is No documentation.
The directory, where the libraries and executables exist, was added to the PATH and PERL5LIB environment variable, and still the XS.pm
is missing in the YAML
folder.
I tried to re-install the library in two different ways: cpanm --local-lib=~/perl5 --reinstall YAML::XS
and cpanm --force -v YAML::XS
still not resolved.
What is happening here, should I install a different version of Perl? Is it possible to manually install YAML/XS.pm
?
submitted by /u/learnwithscholar
[link] [comments]
The URI module took a short holiday, but quickly returned. Just for giggles, I'd like to see everyone react (positivily) to u/oalders in the Github issue:
- Can we get 100 reactions?
- Can we get all the reactions (so, thumbs down is really just for completeness)
- Can we star the heck out of the libperl-www repo?
There are people who take care of things so most people never notice when something goes wrong, and from the time I reported this to resolution was three hours (although the issue was already known, I think). That's some pretty good support right there, and we should fête over that.
For what it's worth, GitHub pays attention to these things. When I filed an issue about getting them to think about putting Perl in their Advisory Database, the number of reactions that issue got made them think about it (right now it's a whole process with scheduling dev time, etc). One of the ways to show that Perl is alive is to react to Perl things (um, that deserve it, not bot spam!).
submitted by /u/briandfoy
[link] [comments]
Hi I am new to this stuff
i want to use scriptthis perl script to simulate the https requests performed by the deep testing app (for realme devices)
now i need to run this script on (strawberry perl)
but i have no pc to do this
so how can i run perl script on termux
everytime i do this on termux
i get this
submitted by /u/dragonuser_
[link] [comments]
Basically, my Perl code wants to achieve the following :
my @array
= qx{cat /some/servers/list}; # this is working
my $port = 30004;
foreach(@array) {
my $return_code = system ("/usr/bin/nc -zv", $_, $port) # wanting to run nc -zv hostname 30004
But it just isn't working.
What I've tried so far :
foreach(@array) {
my @ args = ($_." ".$port)
my $return_code = system ("/usr/bin/nc -zv", @ args)
- Used IPC::System::Simple qx/systemx/ and then passed the whole thing thru systemx instead of system
- Used qx, Used exec, doesn't work.
Note: I need the return code for rest of dependant logic down the road, so have to have the $return_code scalar.
Please help! I'm at my wits end!
submitted by /u/icy-mist-01
[link] [comments]
Does anyone know how long perlmonks.org will be down?
submitted by /u/ContributionEastern7
[link] [comments]
I use Net::SMTP to send emails when a user requests data, and I have the email BCC'ed to my personal Gmail. But while it appears that the user does get the email (even when using Gmail), it's not showing up in my Gmail.
Any suggestions on what the problem might be?
I'm using these modules:
use Net::SMTP; use MIME::Lite; use Digest::MD5 qw(md5_hex);
And this is the script:
$from = 'noreply@example.com'; $login_pass = 'blahblahblah'; $messageID = time(); $msg = MIME::Lite ->new ( From=> "Me <$from>", To=> "recipient@gmail.com", Bcc=> 'me@gmail.com', Subject=> "Subject", 'Message-ID'=> '<' . $messageID . '-' . md5_hex($from) . '-' . md5_hex($found_email) . '@example.com>', Type=> 'multipart/alternative' ); $msg->attach( Type => 'text/plain', Encoding=> 'quoted-printable', Data=> qq~ Plain text version of email ~ ); $msg->attach( Type => 'text/html', Data=> qq~ <b>HTML version of the email</b> ~ ); $msg->scrub(['x-mailer', 'Content-Disposition']); $smtp = Net::SMTP->new( 'mail.example.com', Port => 465, SSL => 1 ); $smtp->auth($from, $login_pass) or die('Could not authenticate'); $smtp->mail($from); if ($smtp->to($found_email)) { $smtp->data(); $smtp->datasend( $msg->as_string() ); $smtp->dataend(); }
submitted by /u/csdude5
[link] [comments]
The notes from the latest meeting of the Perl Steering Council mention:
We exchanged Perl (re)branding ideas with Olaf [Alders]. We will be keeping in touch on that front.
Does anyone here know whether this is only about the camel logo owned by O'Reilly or if there are some bigger changes coming (Perl 7?)?
submitted by /u/Drogoslaw_
[link] [comments]
Hello,
I'm trying to install Request Tracker and in the process am receiving an error that states:
Some dependencies were missing:
DBD::mysql >= 2.1018, != 4.042 ................... MISSING
I'm lost. How to do I resolve this?
Thank you!
submitted by /u/ngrybst
[link] [comments]
Did anyone else receive unsolicited email from the Science Perl Committee announcing a journal for sale? I'm not sure how or why they added my email address to the list. It'd be interesting to see if others also did so.
submitted by /u/mr_chromatic
[link] [comments]