• Shaarli
  • Tag cloud
  • Picture wall
  • Daily
  • RSS
  • Login
4252 shaares
2 / 7
Filters
140 results tagged perl

Unicode::Tussle - Tom's Unicode Scripts So Life is Easier - metacpan.org

QRCode

Tom's Unicode Scripts So Life is Easier

https://metacpan.org/pod/Unicode::Tussle
March 2, 2023 at 11:38:42 AM EST *
perl unicode
FILLER

Perl Advent Calendar 2022 - Create Professional Slideshows with Mojolicious::Plugin::RevealJS

QRCode

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

https://revealjs.com/installation/

https://perladvent.org/2022/2022-12-15.html
February 7, 2023 at 2:58:20 PM EST *
perl presentation slideshow mojolicious
FILLER

PDF document creation with Markup languages | PMPERRY [blogs.perl.org]

QRCode

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 .

https://blogs.perl.org/users/pmperry/2023/01/pdf-document-creation-with-markup-languages.html
February 3, 2023 at 2:19:17 PM EST *
perl pdf markdown
FILLER

Perl Testing in 2023 - DEV Community 👩‍💻👨‍💻

QRCode

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.

https://dev.to/tobyink/perl-testing-in-2023-hd7
February 3, 2023 at 2:17:56 PM EST *
perl testing
FILLER

Announcing Date::Parse::Modern

QRCode

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.

https://www.reddit.com/r/perl/comments/10r05fy/announcing_dateparsemodern/?%24deep_link=true&correlation_id=260983e3-5f5e-477c-b886-91d84587ded4&post_fullname=t3_10r05fy&post_index=3&ref=email_digest&ref_campaign=email_digest&ref_source=email&%243p=e_as&_branch_match_id=1017042970052510291&_branch_referrer=H4sIAAAAAAAAA22P3UrEMBCFn6betd1t%2BrfCIoL4GiEm024wmYTJlOrbO3XVKyEhh%2B9wzkxuzLk8ti2Bc54bk3MTPL63Kj9VXa%2FyFbQpDyIT%2BdWjCXqjcL0dqUo9V92rnH3fm5%2B8TVEAyc1AQR4BEZCLyPOJTsPyKcogpg2tx1U7w5ANFYjJAeFRqKSzdwBZH5tU6oVpg6obbSKCYNgn1N4J78bTZVag6mEZoO6nydZv8zzWl7Ob%2B2GeHLhecjkV1ssWApoIR53Sf6vcTY8OPsRRAggWURCND9r5FQrfobYmZuNX%2FN8taSMLv57AjaO2CVk%2BL%2FR7DHsO8AV%2FZ0EicQEAAA%3D%3D
February 3, 2023 at 2:17:01 PM EST *
dates perl
FILLER

Perl Advent Calendar 2022 - The Christmas Time Machine

QRCode
use Feature::Compat::Try;

try {
    deliver();
} catch($e) {
    print "Failed to deliver\n";
}

https://youtu.be/Kc_bP73xNyM

https://perladvent.org/2022/2022-12-10.html
January 5, 2023 at 10:10:48 AM EST *
perl
FILLER

Perl Advent Calendar 2022 - A Perlmas Tree - pEFL

QRCode

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:

https://perladvent.org/2022/2022-12-08.html
December 19, 2022 at 11:18:46 AM EST *
perl gui efl
FILLER

Input Validation and Errors — Swagg::Blogg

QRCode

I used to use the flash() helper in Mojolicious for reporting errors back to the user but recently discovered I can just use Mojolicious:...

https://blog.swagg.net/input-validation-and-errors
September 16, 2022 at 2:58:47 PM EDT *
mojolicious perl
FILLER

Fast perceptual image hashing with Perl - Dimitrios Kechagias

QRCode

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.

https://tprc2022.sched.com/event/10Fn5

https://www.youtube.com/watch?v=vw4y506TsDA&list=PLA9_Hq3zhoFyOpb-U3DMU7OT93dPUdtpE&index=13
June 27, 2022 at 10:28:41 AM EDT *
perl images
FILLER

What's In That String? | Tom Wyant [blogs.perl.org]

QRCode

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}";

http://blogs.perl.org/users/tom_wyant/2022/05/whats-in-that-string.html
May 31, 2022 at 10:28:51 AM EDT *
perl unicode
FILLER

How much is that BLÅHAJ in the (terminal) window?—The Phoenix Trap

QRCode

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)}'
https://phoenixtrap.com/2022/04/12/how-much-is-that-blahaj-in-the-terminal-window/
May 4, 2022 at 2:06:28 PM EDT *
perl mojolicious
FILLER

Max Maischein. What I learned about SQL in 2018

QRCode

PerlCon 2019 Rīga — Day 2 — 8 August 2019

https://perlcon.eu/talk/56

~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.

https://www.youtube.com/watch?v=-8wJL4qvEOs
April 5, 2022 at 3:51:48 PM EDT *
perl sql mssql
FILLER

Ricardo Signes (‎rjbs‎) - ‎1.21 Gigawatts‎

QRCode

You should write your own debugger!

~25:00

https://speakerdeck.com/rjbs/1-dot-21-gigawatts?slide=174

https://www.youtube.com/watch?v=IG425RMEkRo
March 12, 2022 at 8:49:22 PM EST *
perl debugger
FILLER

Ricardo Signes - The Perl 5 Debugger: Wuh?

QRCode

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.

https://www.youtube.com/watch?v=LtAGbUYTnR0
February 25, 2022 at 2:22:41 PM EST *
perl debugger
FILLER

How to add a relative directory to @INC

QRCode

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;

https://perlmaven.com/how-to-add-a-relative-directory-to-inc
February 8, 2022 at 1:49:21 PM EST *
perl
FILLER

Migrating from LWP::UserAgent to Mojo::UserAgent : perl

QRCode

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;
https://www.reddit.com/r/perl/comments/8njtgi/migrating_from_lwpuseragent_to_mojouseragent/
September 16, 2021 at 2:59:33 PM EDT *
perl mojolicious
FILLER

Kent C. Dodds’ .filter() Trick Will Change How You Use JavaScript | by Dr. Derek Austin 🥳 | Coding at Dawn | Jun, 2021 | Medium

QRCode

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 );
https://medium.com/coding-at-dawn/kent-c-dodds-filter-trick-will-change-how-you-use-javascript-87b5112f9f6d
July 9, 2021 at 9:31:51 AM EDT *
javascript coding perl
FILLER

Debugging with Perl

QRCode

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

https://perlcon.eu/talk/34
May 21, 2021 at 2:57:13 PM EDT *
perl mojolicious debugger
FILLER

unicode - Why does modern Perl avoid UTF-8 by default? - Stack Overflow

QRCode

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.

https://stackoverflow.com/questions/6162484/why-does-modern-perl-avoid-utf-8-by-default
May 11, 2021 at 9:01:16 AM EDT *
perl unicode
FILLER

Playwright and Mojolicious - DEV Community

QRCode

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.

https://dev.to/kraih/playwright-and-mojolicious-21hn
April 5, 2021 at 9:27:52 AM EDT *
mojolicious perl javascript testing
FILLER
2 / 7
Shaarli · The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community · Documentation
Fold Fold all Expand Expand all Are you sure you want to delete this link? Are you sure you want to delete this tag? The personal, minimalist, super fast, database-free, bookmarking service by the Shaarli community