In the spirit of shiny containers gathered neatly under the festive tree, I spent some time using Podman to make a rootless "dockerfile" that contains ALL THE Perl REPLs... as well as a few other useful bits and Object::Pad so people can see how cool the Class/Role syntax is.
Here is the container. Yes, it's big, you will need broadband. ^_^
https://hub.docker.com/r/jemi298/perl-repls-debian
I recommend Podman, but with Docker/Podman, pull the image and give it a try. I tried to make this a "easy"... I'm sure it will download and run faster on your PC than it builds on mine! You could do something like:
Run Devel::REPL... $ use strict; use warnings; use feature 'say'; $ use Object::Pad; $ my @aNumbers = map { $_ } 100..999; $ role rVox { > method doMsg ($inMsg) { say $inMsg; } > } $ class cTEST { > apply rVox; > } $ my $oT=cTEST->new; $ $oT->doMsg(__LINE__. " hello from a REPL!"); 6 hello from a REPL!
The container is based on Debian:Slim (slim, ahem), so let's recognise up front that compared to Alpine Linux, Debian:Slim is a whale! And Devel::REPL in particular depends on a herd of Moose...
This is a learning image, those keen for cloud deployment will not want this to run up their cloud bills.
Here are some of the previous discussions about Perl and containers:
https://old.reddit.com/r/perl/comments/12vv8g4/quick_tip_run_local_perl_code_using_podman_to_run/
https://old.reddit.com/r/perl/comments/sd5403/tiniest_perl_docker_image/
https://domm.plix.at/talks/writing_a_good_dockerfile_for_perl_app.html
Merry Containering, Perling, and REPLing!
submitted by /u/singe
[link] [comments]
I have a Mac M1 chip laptop.
While I have managed to install a couple of modules, most fail to install.
I tried perlbrew, but that was a struggle to even get it to install perl itself, but when it was installed it wasn't working the way I needed it to.
Just wondering if I am missing something with CPAN or if this is an issue because it's an M1 chip?
submitted by /u/MrCosgrove2
[link] [comments]
How to use perl v5.40's boolean builtins in Mojo::Pg queries
The final installment in the series:
"The-Quest-For-Performance" from my blog Killing It with #perl
Discussing #python #numpy #numba, #rstats #openMP enhancements of Perl code and #simd
Bottom line: I will not be migrating to Python anytime soon.
Food for thought: The Perl interpreter (and many of the modules) are deep down massive C programs. Perhaps one can squeeze real performance kicks by looking into alternative compilers, compiler flags and pragmas ?
submitted by /u/ReplacementSlight413
[link] [comments]
The Quest for Performance Part IV : May the SIMD Force be with you
At this point one may wonder how numba, the Python compiler around numpy Python code, delivers a performance premium over numpy.Killing-It-with-PERL
I would be interested to know why you chose Perl and how long you have been using it and what for.
I have just returned to Perl after many years away, think decades rather than a couple of years. Consider me a noob as I've long forgotten anything I knew about the language.
I run a small home webserver, Apache on Windows 10 with Strawberry Perl, and recently started some projects starting with moving away with things like Google Analytics and going back to some old log analyzers such as AWStats, which is still being maintained, and W3Perl, which is not. Even more recently I have started using Ringlink.
Perl is still being developed, Strawberry, Active State, CPAN etc. but lost out to PHP and Python. Just like COBOL, I can easily imagine thousands of systems depend on Perl.
submitted by /u/brisray
[link] [comments]
Download & Install Perl - ActiveState
Download Perl 5.32 and 5.28 from ActiveState & get precompiled Perl distribution. ActiveState Perl is free to download.ActiveState
Have been using the official MongoDB driver to date (https://metacpan.org/dist/MongoDB) but its obviously EOL and now I can't get it to work with perl v.540 on OSX.
For those interested it fails on BSON::XS and I cannot force install either.
cp XS/XS.xs blib/lib/BSON/XS/XS.xs Running Mkbootstrap for XS () chmod 644 "XS.bs" "/usr/local/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- XS.bs blib/arch/auto/BSON/XS/XS.bs 644 "/usr/local/bin/perl" "/usr/local/lib/perl5/5.40.0/ExtUtils/xsubpp" -typemap '/usr/local/lib/perl5/5.40.0/ExtUtils/typemap' xs/XS.xs > xs/XS.xsc mv xs/XS.xsc xs/XS.c cc -c -I. -Ibson -fno-common -DPERL_DARWIN -mmacosx-version-min=14.5 -DNO_THREAD_SAFE_QUERYLOCALE -DNO_POSIX_2008_LOCALE -fno-strict-aliasing -pipe -fstack-protector-strong -I/usr/local/include -D_GNU_SOURCE -DMONGO_USE_64_BIT_INT -DBSON_COMPILATION -Wno-error=implicit-function-declaration -O3 -DVERSION=\"v0.8.4\" -DXS_VERSION=\"v0.8.4\" -o xs/XS.o "-I/usr/local/lib/perl5/5.40.0/darwin-2level/CORE" xs/XS.c xs/XS.xs:216:3: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] PUSHMARK (SP); ^~~~~~~~~~~~~ /usr/local/lib/perl5/5.40.0/darwin-2level/CORE/pp.h:120:5: note: expanded from macro 'PUSHMARK' STMT_START { \ ^~~~~~~~~~ ./ppport.h:4305:31: note: expanded from macro 'STMT_START' # define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */ ^ xs/XS.xs:216:3: note: '{' token is here PUSHMARK (SP); ^~~~~~~~~~~~~ /usr/local/lib/perl5/5.40.0/darwin-2level/CORE/pp.h:120:16: note: expanded from macro 'PUSHMARK' STMT_START { \ ^ xs/XS.xs:216:3: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] PUSHMARK (SP); ^~~~~~~~~~~~~ /usr/local/lib/perl5/5.40.0/darwin-2level/CORE/pp.h:129:5: note: expanded from macro 'PUSHMARK' } STMT_END ^
With that said, whats the most appropriate alternative out there?
submitted by /u/kosaromepr
[link] [comments]
A couple of data/compute intensive examples using Perl Data Language (#PDL), #OpenMP, #Perl, Inline and #Python (base, #numpy, #numba). Kind of interesting to see Python eat Perl's dust and PDL being equal to numpy.
OpenMP and Perl's multithreaded #PDL array language were the clear winners here.
submitted by /u/ReplacementSlight413
[link] [comments]
The Quest for Performance Part I : Inline C, OpenMP and PDL
Sometimes, one’s code must simply perform and principles, such as aeasthetics, “cleverness” or commitment to a single language solution simply go out of the window.Killing-It-with-PERL
Hello all. I installed Perlbrew to try it out using Perl modules without admin rights. My machine is Linux EOS. When I run a simple perl script it gives error Cant locate Modern/Perl.pm in \@INC. How do I make Emacs know that I am using perlbrew and not system Perl? Or how do add the perlbrew PATH to global \@INC? I also have setup Devel::PerlySense inside Emacs following the module documentation. I installed some modules using cpanm client. I'm new to Perl and Emacs and sometimes I'm lost n doesnt know what I'm doing lol 😀 Appreciate your pointing me to the right direction. Below are some log details:
Can't locate Modern/Perl.pm in u/INC (you may need to install the Modern::Perl module) (@INC entries checked: /usr/lib/perl5/5.38/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/5.38/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/5.38/core_perl /usr/share/perl5/core_perl) at ./read_input_stdin line 4.
BEGIN failed--compilation aborted at ./read_input_stdin line 4.
❯ perlbrew info
Current perl:
Name: perl-blead
Path: /home/user/perl5/perlbrew/perls/perl-blead/bin/perl
Config: -de -Dprefix=/home/user/perl5/perlbrew/perls/perl-blead -Dusedevel -Aeval:scriptdir=/home/user/perl5/perlbrew/perls/perl-blead/bin
Compiled at: Jul 6 2024 10:50:31
perlbrew:
version: 0.98
ENV:
PERLBREW_ROOT: /home/user/perl5/perlbrew
PERLBREW_HOME: /home/user/.perlbrew
PERLBREW_PATH: /home/user/perl5/perlbrew/bin:/home/user/perl5/perlbrew/perls/perl-blead/bin
PERLBREW_MANPATH: /home/user/perl5/perlbrew/perls/perl-blead/man
❯ perl --version
This is perl 5, version 41, subversion 2 (v5.41.2 (c5df4fd1012cc64d1b3e19c87bf8c51d4f3f90d6)) built for x86_64-linux
❯ perlbrew list-modules | grep modern
Modern::Perl
submitted by /u/Ill-Dependent2628
[link] [comments]
[link] [comments]
Combining calendars - Perl Hacks
One of the most popular posts I've written in recent months was the one where I talked about all the pointless personal projects I have. The consensus in the many comments I received was that anything you find useful isn't pointless.Dave Cross (Perl Hacks)
Anyone have any insight? https://www.perlmonks.org/r/perl/.rss
submitted by /u/saltyreddrum
[link] [comments]
submitted by /u/OvidPerl [link] [comments] |
An OpenAI Chatbot in Perl
The OpenAPI::Client::OpenAI module is very low-level. We show how to write a wrapper around it for a clean interface with production code.curtispoe.org
I am fairly new to Perl. I did a lot with it in the mid 90s and came back about 8 months ago. There is a lot I dont know and probably a lot of things I have forgotten.
I picked up Perl to write a couple of applications that I was hoping could run on MacOS, Linux,OpenBSD, and Windows. Perl runs on all of them and many come with Perl built in. Simple scripts I have written run pretty well. (Lets forget about Windows for now).
When I start using libraries(packages?) there is a world of hurt.
Now some libraries pretty much usually work, but many do not. Which works and which do not seems to be dependent upon the operating system and distro.
Then I have to start with what version of Perl is running everywhere. That is annoying.
I end up spending a lot of time on a new machine when I want to run my application, doing nothing else than trying to get the libraries installed.
So I decided to adopt PerlBrew (havent tried it on OpenBSD yet) That should give me a stable version across the differnt platforms.
Then I decided I wanted to write a shell script that would handle installing all of the libarires I might use once and for all so I would know they were all accounted for.
perlbrew exec -q --with perl-5.40.0 cpanm install DBI
Then libraries I have pulled from CPAN do not work.
Google here and Google there.
Ok install GCC and make (I should have known this) More problems:
I found a few of these: "Why are you using CPAN for this? Use the compiled packages that come with <OS><type>"
Hmm I would have thought that CPAN shold be the best source? How do I know what exists as pre built packages on what platform?
Using apt search "perl" or "-perl" or "perl" does not help that much.
I have XML::LibXML working on Mac but getting it working on Ubuntu 22 I have been able to do. I have even tried to start OpenBSD yet)
Is writing cross platform applications in Perl meant to be this difficult?
Should I avoid libraries at all costs and write an aweful lot of code myself?
Is there an easy way to guess what libraries will almost certainly work and what libraries will most likely never work? Some kind of warning system?
Should I look into using pp? I havent yet figured out how to make it compile for Ubuntu,MacOs,OpenBSD yet.
In GoLang its a couple of flags to set for each architecture and off it goes.
ShouldI look into Par files? (or was it Far) that are supposesd to contain the nessescary libraries within itself?
What am I doing wrong?
Libraries in my current set Given all the experimenting some of them are now wrong.
Array::Set, Array::Unique, Bundle::LWP, Data::Dump, Data::Dumper, DateTime, DBD::SQLite, DBI, Digest::file, Digest::MD5, Digest::MD5::File, File::Basename, File::Compare, File::Copy, File::Find, File::Find::Rule, File::Glob, File::Path, File::Slurp, File::Spec, Image::ExifTool, Image::Info, IO::All, List::Compare, List::Gen, List::MoreUtils, List::SomeUtils, List::Util, List::UtilsBy, Log::Minimal, LWP, LWP::Simple, Path::Tiny, Term::ANSIColor, Text::Fuzzy, Type::Tiny,Moose,MooseX::Types,WWW::Mechanize
submitted by /u/NoeticIntelligence
[link] [comments]
Repository of examples using Perl and Assembly together
You may have noticed the slow pace of Corinna development. As it turns out, there's an easy way to speed up the development: tell Paul.
I had a call with Paul "LeoNerd" Evans last night and this, including his email address, is being shared with his permission.
As you might imagine, being a core Perl developer, Paul has many things on his plate. Currently has has tons of PRs against the Perl core, he's doing new work such as experimenting with data checks (don't call them "types"!), and is active on the Perl steering council and in P5P. However, he's previously mentioned that he doesn't get much feedback on his work. For adding something as important as Corinna, just blindly adding it without hearing from the community is bad. Yes, we had a multi-year design phase and Corinna is much better for it, but that doesn't mean it's perfect and we don't want to screw this up.
So here's where you come in. Email Paul at leonerd at leonerd.org.uk. Tell him your thoughts about Corinna. He's he one implementing it and working in isolation as he is, despite his work with Object::Pad, isn't good. Tell him what you like, what you don't like, what you'd like to see next, what bugs you've encountered, and so on. Without hearing from you, he has no way of judging community thoughts/support for this project, so he needs your help.
If you'd like a quick refresher on the new syntax, I've written a short introduction. Here's a dead-simple LRU cache written in the new syntax:
use feature 'class'; class Cache::LRU { use Hash::Ordered; field $cache = Hash::Ordered->new; field $max_size :param :reader = 20; method set( $key, $value ) { $cache->unshift( $key, $value ); # new values in front if ( $cache->keys > $max_size ) { $cache->pop; } } method get($key) { return unless $cache->exists($key); my $value = $cache->get($key); $cache->unshift( $key, $value ); # put it at the front return $value; } }
submitted by /u/OvidPerl
[link] [comments]
Pull requests · Perl/perl5
🐪 The Perl programming language. Contribute to Perl/perl5 development by creating an account on GitHub.GitHub
Blogpost about setting the #openmpl environment from within #perl
Other links:
- Brett Estrade's presentation at TPRC
https://www.youtube.com/watch?v=_pzG5DerDT0
- my companion entry at blogs.perl for https://blogs.perl.org/users/chrisarg/2024/07/parallel-perlc-applications-without-tears-using-openmp-controlling-the-openmp-environment.html
perl #openmp #parallelprogramming
submitted by /u/ReplacementSlight413
[link] [comments]
Intermediate OpenMP for Perl Programmers - Brett Estrade - TPRC 2024
#tprc2024 #perl #raku #openmp This is a sequel to my 2021 talk in Houston, “Introduction to OpenMP for Perl Programmers”. That talk covered the essential ele...YouTube
Parallel Perl/C applications without tears using OpenMP: Controlling the OpenMP environment
My job has led me down the rabbit hole of doing some scripting work in Perl, mainly utility tools. The challenge being that these tools need to parse several thousand source files, and doing so would take quite some time.
I initially dabbled in doing very light stuff with a perl -e
one-liner from within a shell script, which meant I could use xargs. However, as my parsing needs evolved on the Perl side of things, I ended up switching to an actual Perl file, which hindered my ability to do parallel processing as our VMs did not have the Perl interpreter built with threads support. In addition, installation of any non-builtin modules such as CPAN was not possible on my target system, so I had limited possibilities, some of which I would assume to be safer and/or less quirky than this.
So then I came up with a rather ugly solution which involved invoking xargs via backticks, which then called a perl one-liner (again) for doing the more computation-heavy parts, xargs splitting the array to process into argument batches for each mini-program to process. It looked like this thus far:
my $out = `echo "$str_in" | xargs -P $num_threads -n $chunk_size perl -e ' my \@args = \@ARGV; foreach my \$arg (\@args) { for my \$idx (1 .. 100000) { my \$var = \$idx; } print "\$arg\n"; } '`;
However, this had some drawbacks:
- No editor syntax highlighting (in my case, VSCode), since the inline program is a string.
- All variables within the inline program had to be escaped so as not to be interpolated themselves, which hindered readability quite a bit.
- Every time you would want to use this technique in different parts of the code, you'd have to copy-paste the entire shell command together with the mini-program, even if that very logic was somewhere else in your code.
After some playing around, I've come to a nifty almost-metaprogramming solution, which isn't perfect still, but fits my needs decently well:
sub processing_fct { my u/args = u/ARGV; foreach my $arg (@args) { for my $idx (1 .. 100000) { my $var = $idx; } print "A very extraordinarily long string that contains $arg words and beyond\n"; } } sub parallel_invoke { use POSIX qw{ceil}; my $src_file = $0; my $fct_name = shift; my $input_arg_array = shift; my $n_threads = shift; my $str_in = join("\n", @{$input_arg_array}); my $chunk_size = ceil(@{$input_arg_array} / $n_threads); open(my $src_fh, "<", $src_file) or die("parallel_invoke(): Unable to open source file"); my $src_content = do { local $/; <$src_fh> }; my $fct_body = ($src_content =~ /sub\s+$fct_name\s*({((?:[^}{]*(?1)?)*+)})/m)[1] or die("Unable to find function $fct_name in source file"); return `echo '$str_in' | xargs -P $n_threads -n $chunk_size perl -e '$fct_body'`; } my $out = parallel_invoke("processing_fct", \@array, $num_threads);
All parallel_invoke() does is open it's own source file, finds the subroutine declaration, and then passes the function body captured by the regex (which isn't too pretty, but it was necessary to reliably match a balanced construct of nested brackets) - to the xargs perl call.
My limited benchmarking has found this to be as fast if not faster than the perl-with-threads equivalent, in addition to circumventing the performance penalty for the thread safety.
I'd be curious to hear of your opinion of such method, or if you've solved a similar issue differently.
submitted by /u/Wynaan
[link] [comments]
submitted by /u/perlancar [link] [comments] |
List of new CPAN distributions – Jun 2024
dist author abstract date Alien-RtAudio JBARRETT Install RtAudio 2024-06-23T15:44:22 Alien-SunVox JBARRETT Install The SunVox Library – Alexander Zolotov's SunVox modular synthesizer and…perlancar's blog
I need some help with the old Perl Gunnar Hjalmarsson's Ringlink program on my site. The forms work, the database gets added to and everything seems ready to go except for the email functions that depend on sendmail.
I have tried several things, installed the CPAN dependencies the program needs, tried Auron SendEmail and other programs and have thoroughly confused myself.
There's a test installation on my site, with the admin and password are both 'test'. There are copies of the CGI files and probably what needs looking at are rlmain.pm, rlconfig.pm and sender.pm
I am running Apache 2.4.54 on Windows 10 with Strawberry Perl installed. I am using the last published version Ringlink (v3.4)
I know this is an old program and the project probably not worth pursuing, but I really would like to give this a go to get it working and would be grateful for any suggestions.
submitted by /u/brisray
[link] [comments]
Auron SendEmail - Auron Software Portable E-mail Freeware
The Auron SendEmail set of portable freeware tools for Windows enable you to send E-mails through from either GUI or commandline.Auron Software
[link] [comments]
(dii) 7 great CPAN modules released last week
Updates for great CPAN modules released last week. A module is considered great if its favorites count is greater or equal than 12. App...niceperl.blogspot.com
Damian on top form as always. The modules this talk is based on are, of course, all both brilliant and incredibly useful. But the thing that's really impressed me here is the way he has taken some of his modules from a couple of decades ago and replaced them with calls to LLMs. That's food for thought.
submitted by /u/davorg
[link] [comments]
The Once and Future Perl - Damian Conway - TPRC 2024
#tprc24 #perl #rakuRetroemotions, statistical outliers, lunar excursions, Lorentz contraction, extrasolar planets, atomic clocks, lucky bullets, Greek mythol...YouTube
I was lucky enough to attend the perl and raku conference this year and had a great time meeting lots of awesome people. I am primarily a designer by trade but do code as well. At the conference, I explored a number of original depictions of the perl camel for fun and this one was my favorite. The idea was to bring a strikingly modern feel to the Perl Camel. Loose inspiration for this symbol is code llama and p****n. This design exploration felt like my way to hack something during the conference! The idea behind this simple symbol is that it could work nicely at very small sizes while still being visually clear. The font is a free open-source display font called Jaro. the first image was also a concept of placing "Perl" in the camel symbol to strengthen the association between the "perl" and the camel symbol as this may be helpful for new developers. I could spend much more time on this but thought I would share! Love it? Hate it? Let me know what you think (especially if you like it) submitted by /u/North-Clue-2313 |
PSA: to get Net::SSLeay to build on a new M3 MBP I had to do export OPENSSL_PREFIX=/opt/homebrew/opt/openssl/include/openssl/
to get it to build on a new M3 MBP with an OpenSSL that was installed via brew install openssl
Filed an issue at https://github.com/radiator-software/p5-net-ssleay/issues/482
submitted by /u/lovela47
[link] [comments]
Build fails on new M3 MBP due to apparent change to OpenSSL include directory · Issue #482 · radiator-software/p5-net-ssleay
On a new M3 MBP to get Net::SSLeay to build I had to do export OPENSSL_PREFIX=/opt/homebrew/opt/openssl/include/openssl/ to get it to build with an OpenSSL that was installed via brew install opens...GitHub
As the conference is happening in Las Vegas right now, recordings of the talks are being posted to YouTube.
https://www.youtube.com/@YAPCNA
Thanks to everyone planning, sponsoring, speaking and coding in the Perl space. I appreciate you all.
submitted by /u/DeepFriedDinosaur
[link] [comments]
The Perl and Raku Conference - Las Vegas, NV 2024
The official YouTube page of The Perl & Raku Conference, hosted by The Perl Foundation.YouTube
My site got exploited the other week. I had a backup of my WordPress domain, so after importing the backup, most of the infected files were gone. However, some files outside the public_html folder were infected. I deleted those files, and my website loads up fine. Just wondering, is there a way I can restore those files without having my hosting company reinstall Perl?
Thx in advance.
/home2/user1/perl5/lib/perl5/x/index.php: SL-PHP-FILEHACKER-fbo.UNOFFICIAL FOUND
/home2/user1/perl5/lib/x/index.php: SL-PHP-FILEHACKER-fbo.UNOFFICIAL FOUND
/home2/user1/perl5/bin/x/index.php: SL-PHP-FILEHACKER-fbo.UNOFFICIAL FOUND
/home2/user1/perl5/x/index.php: SL-PHP-FILEHACKER-fbo.UNOFFICIAL FOUND
-ABS
submitted by /u/AnotherBrokenSpirit
[link] [comments]
Sorry I didn't get this out here earlier (and it's an xpost from Perlmonks), but Perl Community (parent org of the Science Perl Committee that is initiated the Science Track) is giving out a "peoples choice" award at the end of Conference Lightning Talks. It's sincere gesture from us and allows anyone to vote for anyone in the Perl community at large, as a "thank you" from us.
The Science Track talks have been great, some are even starting to come online. Thanks to everyone who made this happen, especially the TPRC Planning Committee.
submitted by /u/OODLER577
[link] [comments]
The 2024 Golden PERL Award
The Golden PERL Award AKA The People's Choice Award is sponsored by PerlCommunity.org and the Public Enrichment & Robotics Labs. Anyone is eligible to cast a vote and anyone in the global Perl community is eligible to receive a vote.Google Docs