Unicode::Tussle - Tom's Unicode Scripts So Life is Easier - metacpan.org
Tom's Unicode Scripts So Life is Easier
Perl Advent Calendar 2022 - Create Professional Slideshows with Mojolicious::Plugin::RevealJS
Santa's elf had a problem. He had to write a presentation very fast and show it to a bunch of new elves. The email assigning this to him was sent by Santa himself. The elf started to look on MetaCPAN and found this module: Mojolicious::Plugin::RevealJS
PDF document creation with Markup languages | PMPERRY [blogs.perl.org]
New, powerful features have recently been added to PDF::Builder and PDF::Table, enabling faster and easier high-level generation of PDF documents. The versions are respectively 3.025 and 1.005, and are available on CPAN.
As well as the ability to "pour" text into a document's defined page areas, and have it flow easily over pages, this new version also enables high level text formatting with markup languages, as well as much-enhanced font management. The markup supports Markdown (via Text::Markdown) and a large (and growing) subset of HTML/CSS, as well as simple paragraphs-only markup, and for the first time can be used to format cells in PDF::Table. This is far from the final version, as many improvements are in the pipeline for this functionality, and are expected to be released over the coming one to two years. These will include, among other things, proper word hyphenation and probably some form of paragraph shaping, such as Knuth-Plass. The full list (at this time) is at https://github.com/PhilterPaper/Perl-PDF-Builder/issues/195 .
Perl Testing in 2023 - DEV Community 👩💻👨💻
With my open source work, I’ve historically taken an approach which relies more on integration... Tagged with perl, tdd, test2suite.
Test2::V0 provides a good base to work with, so we add that to our project’s requirements list straight away.
We’ll round that out with:
Test2::Require::AuthorTesting to skip certain tests when run on the end user’s machine, and require the AUTHOR_TESTING environment variable to run. This is useful for tests which are very slow or require a highly specific environment to run in.
Test2::Require::Module to skip certain tests when optional modules are unavailable.
Test2::Tools::Spec to better structure our unit tests.
Test2::Plugin::BailOnFail for when your tests simply cannot carry on. Use sparingly.
Announcing Date::Parse::Modern
I'm a big fan of PHP's strtotime() so I wanted that same functionality in Perl. If you have a date/time string and need a unixtime, then strtotime() is the way to go.
I just released the first public version of Date::Parse::Modern, which is a modern replacement for Date::Parse. Not only does it support more formats than Date::Parse, it's also significantly faster.
In a perfect world this functionality (strtotime) should be in Time::Piece. It's very common in my work flow to read a log file and need to parse the date/time part of the line to a Unixtime.
Perl Advent Calendar 2022 - The Christmas Time Machine
use Feature::Compat::Try;
try {
deliver();
} catch($e) {
print "Failed to deliver\n";
}
Perl Advent Calendar 2022 - A Perlmas Tree - pEFL
Nowadays you can create a Christmas tree with perl. There was a wonderful module by Dave Cross in the Perl Advent Calendar 2018. But to find the perfect fitting tree, you have to hack the code. Therefore a GUI is needed. And why not to try the new module pEFL?
pEFL is an object oriented binding to the Enlightenment Foundation Libraries. And even if it is a very young module, the Elementary part (the widget toolkit) is already very usable. But let's see:
But before take a deep dive into pEFL we make a global hash for the settings to SVG::ChristmasTree with nice defaults on top of our code:
Input Validation and Errors — Swagg::Blogg
I used to use the flash() helper in Mojolicious for reporting errors back to the user but recently discovered I can just use Mojolicious:...
Fast perceptual image hashing with Perl - Dimitrios Kechagias
Talk slides, images & code used: https://github.com/dkechag/ImagePHash-Talk
This talk will take you through a novel Perl implementation of perceptual hashes for “similar image” searches. I'll start with the basics, if you don't know what a Discrete Cosine Transform is, you'll find out with a visual demo - no math required (although math is always encouraged!). After DCTs and p-hashing basics, I will go through the implementation’s new features that make it efficient and easy to integrate with our large MySQL-based image database.
At SpareRoom, the world’s largest roommate finding service, we handle tens of millions of images, mostly of customer rooms/properties. When tasked with adding an internal ability for a “similar image” search, I first looked at existing solutions and found out that some did not work as expected, while others were either slow or required changes to our infrastructure (mainly Perl, with the data - including the image index - on a large MySQL database).
In the end, I went with a solution initially based on Image::Hash, but with p-hashes reimplemented to fix collision issues and add speed (over 10x faster than pHash.org’s equivalent DCT-based hash). Then, I added features such as support for mirroring, as well as “index/reduced” hashes, in order to effectively use MySQL indices (and thus easily fit in our existing setup).
After an intro to the theory behind the DCT and perceptual hashes in general, I will discuss the abilites of this implementation and the experiences from developing and using it. The module will be released to CPAN before my talk, although the XS part responsible for the fast DCT calculation has been available for a while as Math::DCT.
What's In That String? | Tom Wyant [blogs.perl.org]
local $Data::Dumper::Useqq = 1;
print Data::Dumper::Dumper( $_ );
$VAR1 = "\30\31\32\e\34\35\36\37 !\"#\$%&'";
$VAR1 = "\30\31\32\e\34\35\36\37 !\"#\$%&\x{100}";
How much is that BLÅHAJ in the (terminal) window?—The Phoenix Trap
Using one line of Perl, you can grab the price and even a picture of IKEA’s iconic cuddly shark toy!
https://phoenixtrap.com/2022/04/12/how-much-is-that-blahaj-in-the-terminal-window/
$ perl -Mojo -E 'say g("https://sik.search.blue.cdtapps.com/us/en/search-result-page", form => {types => "PRODUCT", q => "BLÅHAJ"})->json->{searchResultPage}{products}{main}{items}[0]{product}->@{qw(currencyCode priceNumeral)}'
Max Maischein. What I learned about SQL in 2018
PerlCon 2019 Rīga — Day 2 — 8 August 2019
~20:00 - Window functions
~33:45 - CTE
~43:00 - Recursive CTE
This talk shows how to use SQL Window Functions (ISO SQL:2008) and how to use Common Table Expressions (CTE, ISO SQL:1999).
Using these two techniques, you can often avoid munging the query result afterwards. This potentially saves roundtrips between the program and the database.
The presentation assumes an intermediate familiarity with SQL. To get the most of the presentation, youshpuld be familiar with SELECT and JOIN. The Perl level is suitable for the beginner, but there will be very little Perl.
Ricardo Signes (rjbs) - 1.21 Gigawatts
You should write your own debugger!
~25:00
Ricardo Signes - The Perl 5 Debugger: Wuh?
95% of all debugging is print statements, but once or twice a year, a problem shows up that is best attached with perl5db.pl, the venerable core Perl 5 debugger. Like a light saber, it dates back to a forgotten time and its operations are poorly understood. Unlike a light saber, it is not elegant, and nobody aspires to use it. Also, it can cut limbs right off. Still, it’s a very useful multi-purpose tool, and if you learn how to use it, it can save a lot of time and clear up a lot of mysteries.
This talk will cover what the debugger is, how to use it at a basic and intermediate level, how to customize it, and at least one or two stories about how it is very, very awful.
How to add a relative directory to @INC
Solution 5 - Path::Tiny
The solution that I currently like the best, involves the use of the Path::Tiny module
use Path::Tiny qw(path);
use lib path($0)->absolute->parent(2)->child('lib')->stringify;
Migrating from LWP::UserAgent to Mojo::UserAgent : perl
I'm in the process of migrating my development process from the old comfortable tools I've been using for the last handful of years over to Mojo-based code whenever possible. I'd like to thank everyone in this subreddit that's helped me in on this journey of discovery in prior posts, and hope that I can continue to benefit from the wisdom of the collective.
Mojolicious lets you do a lot of things more concisely than some other frameworks/modules, too. This type of setup/flow is normally what I use in my client-side scripts:
my $ua = Mojo::UserAgent->new;
my $post_result = $ua->post(
$endpoint,
{ SOAPAction => $soapaction, 'Content-Type' => 'text/xml' }, # headers
$message # request body
)->result;
Kent C. Dodds’ .filter() Trick Will Change How You Use JavaScript | by Dr. Derek Austin 🥳 | Coding at Dawn | Jun, 2021 | Medium
Kent C. Dodds’ .filter() Trick Will Change How You Use JavaScript. This one-liner uses the Boolean constructor to magically remove all falsy values from an array ✨.
https://twitter.com/kentcdodds/status/1009918457394225152
const plugins = [
isProd ? optimizePlug : null,
isProd ? prodOnlyPlug : null,
!isProd ? testingPlug : null,
usefulPlug,
].filter( Boolean );
Debugging with Perl
Eugen Konkov — 45 minutes 🐪
Interactive debugging.
This talk about how to catch and report perl application exceptions.
An example based on Mojolicious web server will be given.
I will show how to reproduce exceptions and debug them.
The example will describe how to access and view data at any stack frame.
Also I will show how to implement new debugger commands and how to debug them (yeah, you understand right: how to debug perl debugger while debugging)
This talk will about my second proprietary debugger. It is full rewrite of first version: https://github.com/KES777/Devel-DebugHooks
unicode - Why does modern Perl avoid UTF-8 by default? - Stack Overflow
I wonder why most modern solutions built using Perl don't enable UTF-8 by default.
Saying that “Perl should [somehow!] enable Unicode by default” doesn’t even start to begin to think about getting around to saying enough to be even marginally useful in some sort of rare and isolated case. Unicode is much much more than just a larger character repertoire; it’s also how those characters all interact in many, many ways.
Playwright and Mojolicious - DEV Community
It's Hack Week again at SUSE. 🥳 An annual tradition where we all work on passion projects for a whole... Tagged with mojolicious, perl, javascript, node.