@rmloveland I really like @oalders’s new logo too! Sorry, @kraih, I think your #Perl5 raptor is out.
/ @perl
@rmloveland I really like @oalders’s new logo too! Sorry, @kraih, I think your #Perl5 raptor is out.
/ @perl
I like the proposal for a new #perl logo!
I need #perl help for a minute. I have files in /tmp/ of the pattern "poster-123456.jpg" where 123456 is a random number of digits.
I want to remove all those files older than one hour.
Does this short routine do it (safely)?
sub removeOldPosters
{
my $keep_as_of = time - 3600 ;
my @old_files = (
grep{ !-d
&& /poster-[\d]+\.jpg$/i
&& ( stat( $_ ) )[9] < $keep_as_of
}
glob( "/tmp/*" )
);
unlink @old_files;
}
@tewha
#Perl @PerlWChallenge 296 Task 1: String Compression
#noxp
```
perl -E '
for(@ARGV){$x=$_; $x=~s/(.)(\1+)/$1.(1+length $2)/ge; say "$_ -> $x"}
' abbc aaabccc abcc
```
@tychotithonus @philsplace I do it in #Perl as well. In #BBEdit, this is my current open documents list. ONE python script cos #Plex tools are few and far between...and that build.sh? That's to build FFMPEG and associated libraries. The rest? Perl. 🤷♂️
Also, please don't criticize my naming convention(s). I don't have one...😂
When I want something to keep working ... I write it in Perl.
Legible¹, modern, simple ... Perl.
Every other language is a never-ending hellscape of "stop thinking about the problem because you're making me think about the tool instead".
I do not have time to constantly refresh my mental-model cache of ten layers of your platform's installation abstractions.
I do not have time to perpetually chase a sliding window of backwards incompatibility, nested dependencies, inscrutable errors, curl|sudo bash
-isms, and dead-end / WONTFIX help threads.
I do not have time to PR your GitHub README to supply the seven implied assumptions missing from your "quick start".
I have work to do.
¹Yes, you can do that. Damian Conway's "Perl Best Practices" is definitive.
Happy new year, #CPAN! 🎂
The Comprehensive #Perl Archive Network, CPAN, has been online publicly since 1995-10-26. By now it hosts over 250,000 modules in 40,000+ distributions by 6,700+ authors.
I publish solutions there since 2014, and I intend to continue for at least another decade.
Join the occasion by registering your account, upload your first module, or release a new version of your existing distribution!
How do you celebrate this year?
So I wrote a #Mojolicious #perl fortune telling tarot card app that uses openai to interpret the card spreads. I myself don't care about fortune telling at all, but I want to find someone who does and knows about Tarot, to beta test. Anyone know of anyone? 😅
2/
So first, I was like, ok fine i dont have time for this, but i spent a few days shaving other yaks and i come back to this problem, i need some visibility on this layer. yeah, i could turn it on globally for the db, but i want to target just my activity, in a test. So I decide to dive in. I’m not super experienced with the #perl #debugger but i should be able to figure this out.
(1/*) So, I’m working in an older #perl codebase. There’s a small home-rolled ORM using #DBI -- not fancy. I wanted to start understanding the data model, so I went looking for a logging module, found https://metacpan.org/pod/DBI::Log and inserted that into a test script i’m writing. And…
```
$ perl test.pl
-- Wed Oct 13 13:36:21 2024
-- /home/pyrrhlin/repo/path/DB.pm 160
SET NAMES 'utf8'
Segmentation fault (core dumped)
```
#fossangel's favorite brand
Taken to their limits, all #programming languages will end up looking like #Perl.
(Libcello is a high level C language)
Why do I keep hitting the weird bugs?
Latest CryptX version is sensitive to whitespace in PEM.
@nettles Is there anybody reviewing pull requests who doesn't just click that button right away?
Maybe it's a #perl thing, but if you've changed a file enough to get a "Big diff" warning, you've stuffed a lot of perl in there. Most likely, too much perl.
@EndlessMason @gugod 1 is a special value that's different from anything else "forty-two". Also running code as script.pl never required a return value but always warned about useless use of constant because only modules use()d or files require()d were required to return a true value to indicate successful loading.
This "Useless use" message can be easily made by just having a statement with only a string literal inside. The message reads interestingly and rather high context -- meaning: readers need to learn at least a little bit about the concept of context in Perl programming language, to be able to understand that no words in that message are useless or void.
# perl x.pl
Useless use of a constant ("forty-two") in void context at x.pl line 3.
# cat x.pl
use v5.36;
"forty-two";
I accidentally discovered that's entirely possible to implement an entire blog as a #Perl one-liner
This is a terrible idea so I'm definitely going to keep expending it
I love Oxygen Not Included in the same way I loved learning
How come PHP is down in the bottom left? It was probably more widespread than Perl and more frequently the "P" in LAMP deployments.
There are more PHP programmers (the dot is red, compared to blue for Perl), so supply-demand balance seems in play.
But what would be the forces driving the sides of that balance? How come they balanced out so differently for Perl compared to PHP?
I've used #Perl since version 4, which is a long time ago. It's still the mainstay for me, but I was surprised to see this graphic in the #StackOverflow 2024 Developer Survey with Perl out in the top-right corner. It seems to be in a sparse group with Cobol, Fortan, and Delphi. Anyone want to opine on why this is?
I have stumbled into the tar pit of #perl shebang. I use Perlbrew. I have (unpopular) Perl modules on CPAN. I call my Perl modules from cron.
Perl modules using ExtUtils::MakeMaker have their shebang line rewritten on installation, unless you use #!/usr/bin/env perl
.
If I use #!/usr/bin/perl
, I cannot run the test for my code because at this point the path has not been rewritten and so the dependencies are missing.
If I use #!/usr/bin/env perl
, I must specify the full path to the Perl interpreter in my crontab because otherwise it will use the system perl and so the dependencies are missing.
There's an open issue since 2013 that is unresolved.
https://github.com/Perl-Toolchain-Gang/ExtUtils-MakeMaker/issues/58
What am I supposed to do? I guess I am going to specify the full path to the Perl interpreter in my crontab.
@mjgardner I wonder if here some tricks like:
use feature "ALL_IS_UTF8";
to let me get rid of those lines:
```
use Encode qw/decode/; # @argv
use utf8; # unicode in script
binmode STDOUT, ":utf8"; # Wide character in print (use v5.30;)
```
(v5.38.2) here.
@tusooa @eexpss Good news! You can say `use v5.36;` (or `use 5.036;` and get #Perl warnings enabled too!
@mjgardner @mhd @drmorr I love #perl , just because I always scribble, and it always gives me the results I want. And I rarely use the "use strict". 🤪