Yeah this is what effectively it does. The pattern is used as a factory of functions. In the #Perl case, the "Intermediate Perl" and "Higher Order Perl" books spends a lot of time discussing this pattern because it allows you to develop useful things e.g iterators.
๐ Spot the difference?
Both define an outer function (plus).
Both return an inner, anonymous function.
Both "close over" the variable in the parent scope.
R uses environments; Perl uses lexicals. Same logic, different syntax. ๐ค
#FunctionalProgramming #CodingTips #ComputerScience #RStats #Perl
๐ก R and Perl are more alike than you think!Both use lexical scoping to create closures. The inner function "captures" the variable from the outer scope, creating a persistent environment.
#rstats
plus <- function(x) {
function(y) x + y
}
plus_one <- plus(1)
plus_one(10) #11
#perl
sub plus {
my [โฆ]
๐ Spot the difference?
Both define an outer function (plus).
Both return an inner, anonymous function.
Both "close over" the variable in the parent scope.
R uses environments; Perl uses lexicals. Same logic, different syntax. ๐ค
#FunctionalProgramming #CodingTips #ComputerScience #RStats #Perl
3/3
#perl
sub plus {
my ($x) = @_;
sub {
my ($y) = @_;
$x + $y
}
}
my $plus_one = plus(1);
$plus_one->(10); # 11
#FunctionalProgramming #CodingTips #ComputerScience #RStats #Perl
2/
๐ก R and #Perl are more alike than you think!Both use lexical scoping to create closures. The inner function "captures" the variable from the outer scope, creating a persistent environment.
#rstats
plus <- function(x) {
function(y) x + y
}
plus_one <- plus(1)
plus_one(10) #11
1/
Dev Reads Perl Code Aloud, Accidentally Summons Beelzebub globalglob.dev/articles/dev...
Local developer Rick Spellman was perusing the Perl code of a back-of-house cataloguing application used by the Accounting department. While muttering lines of code aloud...
#perl #software #regex #daemon
Playing around with #starman and #dancer2, since apparently no one uses #perlcgi any more.
If anyone can recommend some beginner resources, I'd appreciate it, specifically around form processing and DB interactions.
#perl #selfhosting #selfhosted #webcrafting #webserver
This morning, for a paid project, I compiled #Perl on my circa-2020 MacBook for the first time, and then set cpanm to install the projectโs library dependencies. It paused for a while on DBIx::Class, and it felt like a moment of silence. I am feeling feelings.
Perl Weekly Challenge 367's tasks are "Max Odd Binary" and "Conflict Events". Since my wife won't let me forget I'm part of "the Phil Collins set"1, let's lean into it and say this week's musical theme is Against All Odds.
#PerlWeeklyChallenge #raku #perl #python #elixir
The crypto market is wobbling on a tightrope! ๐ฌ #JTOF plunged 13.84% to $0.298, #PERL took a nosedive of 20.55% at $0.0046, while #WTC crashed a staggering 56.54% to $0.0103! Even #CETUS slipped 11.03% to $0.02169, and #CFD is down 63.83% at $0.0918. Time to reassess those portfolios! #Crypto
Today would have been Matt Trout (MST)'s 43rd birthday :( #perl
Perl users: HIGH severity vuln in Compress::Raw::Zlib exposes 5.9.4 โ 5.43.0 to memory & code execution risks. Update to 2.221+ now! Details: radar.offseq.com/threat/cve-2026-4176-cwe... #OffSeq #Perl #Security
CRITICAL: CASIANO GRID::Machine โค0.127 lets a compromised remote host run code on the client via unsafe Perl deserialization. Only connect to trusted hosts & review RPC usage. radar.offseq.com/threat/cve-2026-4851-cwe... #OffSeq #CyberAlert #Perl
**Projekt-Update: Optimierung unserer โRebellen-Solar-Anlageโ nach drei Jahren Betrieb**
Nach einer dreijรคhrigen Test- und Betriebsphase lรคsst sich ein positives Fazit ziehen: Unsere Eigenbau-Solaranlage lรคuft zuverlรคssig. Doch wie bei jedem gewachsenen [โฆ]
[Original post on social.amichan.de]
I mean, even #Perl can catch you out, if you set something equal to \@stuff (which is a reference to @stuff, so changes with it) rather than [@stuff] (which is a reference to a brand new anonymous array with the same contents as @stuff). But @copy = @orig; works as expected.
This is just insane ....
"pperl is a next-generation #Perl 5 platform written in #Rust, targeting Perl 5.42+ compatibility."
Parts of it appear to have been generated by code assist (and it is not clear what will happen to the XS modules) but ๐ช work! [โฆ]
This is just insane ....
"pperl is a next-generation #Perl 5 platform written in #Rust, targeting Perl 5.42+ compatibility."
Parts of it appear to have been generated by code assist (and it is not clear what will happen to the XS modules) but ๐ช work!
perl.petamem.com/docs/eng/int...
This is just insane ....
"pperl is a next-generation #Perl 5 platform written in #Rust, targeting Perl 5.42+ compatibility."
Parts of it appear to have been generated by code assist (and it is not clear what will happen to the XS modules) but ๐ช work! [โฆ]
I guess Perl (the programming language is not dead yet. GPT-5.4 (through the Codex App) just used it to answer a question I had about a bunch of files... #perl #ai #codex
Perl Weekly Challenge 366's tasks are "Count Prefixes" and "Valid Times". When I looked at the second task, and I saw how the times were changin', I needed to listen to some Robert Allen Zimmerman.
#PerlWeeklyChallenge #raku #perl #python #elixir
Numbers and strings are fully interchangeable in #Perl -- yet it still manages to get it right every time, by dint of having distinct operators for addition and concatenation, and also distinct operators for numeric and stringwise comparison.
In #Perl, all the plumbing is exposed, so it's very easy. If you have an existing "color" class, you can create a "colour" class whose constructor function blesses all its members into a separate "color" class on which it depends. Then colour->new() instantiates an object of type "color".
#Perl as a Data Science Language
www.iconoclasts.blog/chrisarg/per...
programming languages
Do you want to quickly learn a new programming language while still having a fairly good knowledge of another, such as Ruby?
#Polyglot #Learning #JavaScript #Ruby #Python #PHP #Perl #Java #Go #Rust
#Perl #Perl5 as a data science language
www.iconoclasts.blog/chrisarg/perlasadatascil...
Perl Weekly Challenge 365's tasks are "Alphabet Index Digit Sum" and "Valid Token Counter". I thought about trying to find some song referencing tokens or validity, but I kept hearing Caroll Spinney's voice in my head.
#PerlWeeklyChallenge #raku #perl #python #elixir
packy.dardan.com/b/kv
Perl was weird, brilliant, and foundational to the early web.
Before modern frameworks, Perl powered CGI scripts, forms, search tools, counters, and dynamic websites. Too many people remember Perl as a punchline history says otherwise.
linuxexpert.org/perl-the-str...
#Perl #Linux #CGI #OpenSource
Whoa, the fluctuations are jaw-dropping! ๐ณ #PERL is on the upswing, skyrocketing by 10.78% at โฟ0.00000113, while #VIB is facing a tough time, slipping down 12.07% to โฟ0.00000051. But #WBTC and #HFT are really struggling, down by 29.23% and 34.04% respectively! It's a rollercoaster ride! ๐ข #Crypto