Published by Perl Steering Council on Thursday 02 May 2024 20:46
We were back from the PTS in Lisbon, and had a shorter meeting than usual, during which we mostly discussed the last remaining release blockers for 5.40.
Published by laurent_r on Thursday 02 May 2024 20:33
These are some answers to the Week 267, Task 2, of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Spoiler Alert: This weekly challenge deadline is due in a few days from now (on May 5, 2024 at 23:59). This blog post provides some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.
You are given a string, $str
, and a 26-items array @widths
containing the width of each character from a to z.
Write a script to find out the number of lines and the width of the last line needed to display the given string, assuming you can only fit 100 width units on a line.
Example 1
Input: $str = "abcdefghijklmnopqrstuvwxyz"
@widths = (10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10)
Output: (3, 60)
Line 1: abcdefghij (100 pixels)
Line 2: klmnopqrst (100 pixels)
Line 3: uvwxyz (60 pixels)
Example 2
Input: $str = "bbbcccdddaaa"
@widths = (4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10)
Output: (2, 4)
Line 1: bbbcccdddaa (98 pixels)
Line 2: a (4 pixels)
The first step is to build a hash, %widths
, mapping each letter of the alphabet to its width. Then, we iterate over the letters of the input string: we keep adding letters to the current line so long as the line is not more than 100, or we start a new line.
sub line-count(@in_widths, $in_str) {
my $i = 0;
my %widths;
for 'a'..'z' -> $let {
%widths{$let} = @in_widths[$i++];
}
my $line-count = 1;
my $line-width = 0;
for $in_str.comb -> $let {
my $tmp = $line-width + %widths{$let};
if $tmp <= 100 {
$line-width = $tmp;
} else {
$line-count++;
$line-width = %widths{$let};
}
}
return "($line-count, $line-width)";
}
my @tests = (10 xx 26, "abcdefghijklmnopqrstuvwxyz"),
([4,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10], "bbbcccdddaaa");
for @tests -> @test {
printf "%-28s => ", @test[1];
say line-count @test[0], @test[1];
}
This program displays the following output:
$ raku ./line-count.raku
abcdefghijklmnopqrstuvwxyz => (3, 60)
bbbcccdddaaa => (2, 4)
This is a port to Perl of the above Raku program. We first build a hash to map letters to their width, and then iterate over the letters of the input string to fill lines with length not more than 100.
use strict;
use warnings;
use feature 'say';
sub line_count {
my @in_widths = @{$_[0]};
my $in_str = $_[1];
my $i = 0;
my %widths;
for my $let ('a'..'z') {
$widths{$let} = $in_widths[$i++];
}
my $line_count = 1;
my $line_width = 0;
for my $let (split //, $in_str) {
my $tmp = $line_width + $widths{$let};
if ($tmp <= 100) {
$line_width = $tmp;
} else {
$line_count++;
$line_width = $widths{$let};
}
}
return "($line_count, $line_width)";
}
my @tests = ( [[10,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10],
"abcdefghijklmnopqrstuvwxyz"],
[[4,10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10],
"bbbcccdddaaa"]);
for my $test (@tests) {
printf "%-28s => ", $test->[1];
say line_count $test->[0], $test->[1];
}
This program displays the following output:
$ perl ./line_count.pl
abcdefghijklmnopqrstuvwxyz => (3, 60)
bbbcccdddaaa => (2, 4)
The next week Perl Weekly Challenge will start soon. If you want to participate in this challenge, please check https://perlweeklychallenge.org/ and make sure you answer the challenge before 23:59 BST (British summer time) on May 12, 2024. And, please, also spread the word about the Perl Weekly Challenge if you can.
Published by Chad 'Exodist' Granum on Thursday 02 May 2024 20:17
I just got back from the Perl Toolchain Summit 2024 in Lisbon Portugal!
Thank you to Grant Street Group for sponsoring my attendance at the event! Grant Street Group is an amazing place to work, and GSG is hiring! Contact me on irc.perl.org (Exodist) if you would like a referral.
This year I took a little side trip before the PTS to explore Lisbon with my wife. It is an amazing city, with a lot of history. I highly recommend visiting it and exploring the castles, palaces, and archaeological sights!
My goal for the PTS was to polish up Yath 2.0 and get it out the door. Spoiler alert: I did not achieve this goal, though I did make good progress. Instead several other things occurred that were even better as far as achieving things that require collaboration go!
Test2/Test2::Suite updates
I had several bug reports that built up over the last couple months. Most of my first day at the PTS was spent fixing these and minting new releases. See the changelog for Test-Simple for details. Without this event it would have been harder to find time to work all these. I also fixed a couple other modules, see my module upload list for all the modules I updated at the PTS.
PAUSE contribution
The PAUSE developers needed a way to manage concurrency. Charsbar (Kenichi Ishigaki) approached me about Parallel::Runner, which was exactly what they needed, but used some outdated modules as I have not touched it in almost a decade. I was able to mint a new release with better and more modern dependencies. Now Parallel::Runner is used under the hood for some PAUSE processes.
Using Yath to test modules on install
Additionally Garu approached me and Leon T. about using Yath as a better and universal way to test modules and upload results to cpanm. This resulted in a collaboration between myself and Leon where we made it will be possible to tell cpan, cpanm, etc to use Yath instead of prove! Once Yath 2.0 and a non-dev version of the new Test-Harness are both available you can do this.
Yath working group (not an official name)
Garu, Preaction, Ilmari, and I came together to discuss Yath. A new goal for yath is to make it possible for Yath to send cpan testers reports. Garu wants a clear and easy way to make reports. Yath, specially with the above changes to Test-Harness should greatly simplify the process. (We also need a cpantesters plugin for Yath)
Ilmari helped me out with an Audit of the DBIc::Class components of Yath, as well as a short review of the schema where he fixed some index definitions. I am very grateful for this code review.
Preaction and I discussed creating a cpan central Yath server (formerly Yath::UI). This would be a very useful tool both for people running tests, and people trying to fix any issues the tests reveal.
Finally we are now trying to plan a Yath hackathon some time this year to all get together and improve Yath. If 2.0 is not released before the hackathon then the goal of the hackathon will be to get it there.
Other items
Many other things happened at the PTS. We had discussions about security and PAUSE/cpan. Metacpan and PAUSE both had significant work done to them, and both are much better today as a result.I did not actively participate in these improvements, so stay tuned for blogs from other attendees!
Monetary sponsors:
Booking.com, The Perl and Raku Foundation, Deriv, cPanel, Inc Japan Perl Association, Perl-Services, Simplelists Ltd, Ctrl O Ltd, Findus Internet-OPAC, Harald Joerg, Steven Schubiger.
In kind sponsors:
Fastmail, Grant Street Group, Deft, Procura, Healex GmbH, SUSE, Zoopla.
Published by TomR on Thursday 02 May 2024 18:35
I'm trying to use a string provided as command-line argument as a format specifier in a sprintf statement in a Perl script, e.g., myscr.pl -fmt="%.2f\t%.1f\n"
on the command-line. In the script, I have somewhere (undef,$fmt)=split(/=/)
to extract the format string, and then I use it as follows: $d=sprintf($fmt,$l[$i],$l[$j])
in some loop. This doesn't quite work, the result looks like this:
2.32\t375.8\n2.37\t386.3\n
i.e., the tab and newline formatters are ignored and treated as normal letters, but the number of digits is processed correctly. On the other hand, I also have a default $fmt="%.3f\t%.3f\n"
in case no option -fmt
is provided, and that produces the correct format in the same sprintf
statement:
2.323 375.817
2.372 386.275
Why? What do I have to do to pass a format specifier as a command-line argument the way I intend?
Published by /u/leonerduk on Thursday 02 May 2024 16:52
Published by tonycoz on Thursday 02 May 2024 15:28
perly LSTOPSUB: prevent a double op free between parse stack and CV The reeproducer resulted in the "block" OP being both on the parser stack and attacked to the CV. If an error occurred while parsing the rest of the list operator clean up would release the OP as attached to the CV, and the same OP on the parse stack, resulting in a double free. It's unclear to me whether bison is intended to support modifying the parse stack entry like this, but it appears to work here. Fixes #21724
Published by david on Thursday 02 May 2024 12:50
I'm trying to remove all directories whose path matches a certain pattern from the path, within a script that would be sourced using .
. The script prints a warning "Substitution replacement not terminated at -e line 1.
" when sourced:
Edit: including full script. Note that there are multiple errors here!
vv=`echo $0 | perl -ne 's/([0-9]+)/ and print $1'`
node_home=`ls -d /opt/node$xx* | head -1`
PATH=`perl -e 'print join q{:},grep !m{/node-},split(m{[:]},$ENV{"PATH"})'`
PATH=$node_home/bin:$PATH
But the warning doesn't appear when I enter the first PATH=
line into bash interactively.
Published by user1742494 on Thursday 02 May 2024 08:26
I've got everything working on my small web app, even payments and hosting. It's just an app that takes scheduling information as input into a database, then it organizes it into a heavily formatted spreadsheet for download. The last thing I realize I need is reliable sessioning. I switched from the "Simple" setting to "Memcached" and then "Cookie" but I noticed the cookies don't expire.
config.yml
session: Cookie
engines:
session:
Cookie:
secret_key: 'Sooper Sekrit Passfraze Hear'
default_duration: 18000
with_request_address: 0
The cookie don't expire even if I set default_duration
for 18000
seconds. I can walk away for an hour or even stop the plack/Starman server and come back and the web app still picks up from where it left off without having to log back in. I now realize the module doesn't do what I was expecting and that my conceptualization of sessioning might be wrong as well. But there aren't many Dancer2 examples. Can anyone help me out and offer some pointers? I really just want to get something simple working that's reasonably secure. Thanks!
Published by London Perl Workshop on Thursday 02 May 2024 00:02
The London Perl & Raku Workshop (LPW) will take place this year on Saturday 26th October and you are encouraged to submit your talk proposals now. We have already had 30 registrations for the workshop so we anticipate a good turnout this year.
We welcome proposals relating to Perl 5, Raku, other languages, and supporting technologies. We may even have space for a couple of talks entirely tangential as we are close to finalising the venue (very central London) and should have room for two tracks.
Talks may be long (40mins), short (20 mins), or very short (aka lightning, 5 mins) but we would prefer talks to be on the shorter side and will likely prioritise 20min talks. We would also be pleased to accept proposals for tutorials and discussions. The deadline for submissions is 30th September.
We would really like to have more first time speakers. If you’d like help with a talk proposal, and/or the talk itself, let us know - we’ve got people happy to be your talk buddy!
Register (it's free!) and submit your talk on the workshop site.
We would also like to make a call for sponsors - does your company want to support the workshop? By sponsoring LPW you can demonstrate your support for the Perl and/or Raku languages and nurture your relationship with the local developer community. Much more information can be found on the workshop site along with a sponsor prospectus.
As well as the benefits as listed on the aforementioned page, sponsors will all feature in blog posts, news posts, social media posts. That starts right now, with our first sponsors who have already generously sponsored the workshop:
With thanks from The London Perl & Raku Workshop 2024 organising team.
Published by tonycoz on Wednesday 01 May 2024 22:46
Revert "testsuite.yml: workaround cygwin base address conflict in 5.39.10" This reverts commit c635fa2209aa81381fc45f5e89f5b16144056521. With the 5.39.11 version bump there's no longer any risk of this collision.
Published by laurent_r on Wednesday 01 May 2024 20:37
These are some answers to the Week 267, Task 1, of the Perl Weekly Challenge organized by Mohammad S. Anwar.
Spoiler Alert: This weekly challenge deadline is due in a few days from now (on May 5, 2024 at 23:59). This blog post provides some solutions to this challenge. Please don’t read on if you intend to complete the challenge on your own.
You are given an array of @ints
.
Write a script to find the sign of product of all integers in the given array. The sign is 1 if the product is positive, -1 if the product is negative and 0 if product is zero.
Example 1
Input: @ints = (-1, -2, -3, -4, 3, 2, 1)
Output: 1
The product -1 x -2 x -3 x -4 x 3 x 2 x 1 => 144 > 0
Example 2
Input: @ints = (1, 2, 0, -2, -1)
Output: 0
The product 1 x 2 x 0 x -2 x -1 => 0
Example 3
Input: @ints = (-1, -1, 1, -1, 2)
Output: -1
The product -1 x -1 x 1 x -1 x 2 => -2 < 0
We can simply compute the product of all the integers in the input array. For this, the canonical way in Raku would be to use the [*]
reduction operator. Once we have computed the product, we can use the ?? .. !!
ternary conditional operator to output 1, 0, or -1, depending on the sign of the product. This is simple enough to be done in a Raku one-liner:
$ raku -e 'my $p = [*] @*ARGS; say $p > 0 ?? 1 !! $p == 0 ?? 0 !! -1;' 2 4 3 6
1
$ raku -e 'my $p = [*] @*ARGS; say $p > 0 ?? 1 !! $p == 0 ?? 0 !! -1;' 2 -4 3 6
-1
$ raku -e 'my $p = [*] @*ARGS; say $p > 0 ?? 1 !! $p == 0 ?? 0 !! -1;' 2 -4 3 6 0 -3
0
This can be made even simpler (or, at least, shorter) using the cmp
"smart" three-way comparator. Note that, in Raku, cmp
is a "smart" comparison operator, that it is compares strings with string semantics and numbers with number semantics. Also note that cmp
returns order
objects (Same, More, or Less), but these get coerced into 0, 1, or -1, respectively, in numeric context. We use a +
to force a numeric context.
$ raku -e 'my $p = [*] @*ARGS; say +($p <=> 0)' 2 -4 3 6
-1
$ raku -e 'my $p = [*] @*ARGS; say +($p <=> 0)' 2 -4 3 6 -6
1
$ raku -e 'my $p = [*] @*ARGS; say +($p <=> 0)' 2 -4 3 6 0 -6
0
This being said, computing the full product when we only need its sign may be a waste of CPU cycles if the integers of the input list are large. We can read the input integers one by one and keep track of the product sign 0, 1, or -1). Here, we use again the cmp
"smart" three-way comparator at each iteration through the input list..
sub product-sign (@in) {
my $result = 1;
for @in -> $i {
$result *= $i cmp 0;
}
return $result;
}
my @tests = <-1 -2 -3 -4 3 2 1>, <1 2 0 -2 -1>, <-1 -1 1 -1 2>;
for @tests -> @test {
printf "%-18s => ", "@test[]";
say product-sign @test;
}
This program displays the following output:
$ raku ./product-sign.raku
-1 -2 -3 -4 3 2 1 => 1
1 2 0 -2 -1 => 0
-1 -1 1 -1 2 => -1
This is a port to Perl of the above Raku program. Note that we have to use the <=>
numeric comparison operator (instead of cmp
) to force a numeric comparison semantics.
use strict;
use warnings;
use feature 'say';
sub product_sign {
my $result = 1;
for my $i (@_) {
$result *= $i <=> 0;
}
return $result;
}
my @tests = ( [<-1 -2 -3 -4 3 2 1>],
[<1 2 0 -2 -1>],
[<-1 -1 1 -1 2>] );
for my $test (@tests) {
printf "%-18s => ", "@$test";
say product_sign @$test;
}
This program displays the following output:
$ perl ./product-sign.pl
-1 -2 -3 -4 3 2 1 => 1
1 2 0 -2 -1 => 0
-1 -1 1 -1 2 => -1
The next week Perl Weekly Challenge will start soon. If you want to participate in this challenge, please check https://perlweeklychallenge.org/ and make sure you answer the challenge before 23:59 BST (British summer time) on May 12, 2024. And, please, also spread the word about the Perl Weekly Challenge if you can.
Published by Joseph White on Wednesday 01 May 2024 12:46
The script I am working on was perfectly functional 2 hours ago, printing results to a file. After minor changes, including addition of a loop, the script stopped printing to file.
Env: Windows 10 command line; perl version v5.32.1.
Some code:
if($resultFile ne ''){
print "Opening $resultFile for output\n";
open(OUT,">$resultFile") || die "Could not open output file, $resultFile;$!\n";
print OUT "test 0\n";
}
# test code
my $list = 'foo';
my $newline = "bar\n";
open FH, '>', "$list.tmp" or die "$list == $!";
print FH $newline or die "Error print: $!";
#close FH;
print $newline;
## begin CASES loop
my $i=0;
while(\<CASES\>) {
my $case = $_;
chomp($case);
print "$case\n";
print OUT "$case\n";
my @data1;
[snip : a lot of processing]
print "@data1\n";
print OUT "@data1\n";
print FH "test 6\n";
## end of CASES loop
}
Output: (after printing for a short time)
> type test_results3.txt
''
> type foo.tmp
''
If I let the script run longer, output will show up in test_results3.txt, but not foo.tmp.
I have $| = 1
set in the top of the script.
So my question is: why is data not being dumped immediately after each print statement -- as it is supposed to do for $|=1
?
Is there some minimum amount of buffering going on? The $|=1
is supposed to turn off output buffering.
What's going on here?
Published by /u/perlancar on Wednesday 01 May 2024 03:08
submitted by /u/perlancar [link] [comments] |
Published by perlancar on Wednesday 01 May 2024 02:38
dist | author | abstract | date |
---|---|---|---|
AI-Ollama-Client | CORION | Client for AI::Ollama | 2024-04-05T09:15:33 |
Acme-CPANModules-BPOM-FoodRegistration | PERLANCAR | List of modules and utilities related to Food Registration at BPOM | 2024-04-27T00:06:16 |
Acme-CPANModules-JSONVariants | PERLANCAR | List of JSON variants/extensions | 2024-04-29T00:05:46 |
Alien-NLOpt | DJERIUS | Build and Install the NLOpt library | 2024-04-28T00:59:11 |
Alien-onnxruntime | EGOR | Discover or download and install onnxruntime (ONNX Runtime is a cross-platform inference and training machine-learning accelerator.) | 2024-04-17T22:03:45 |
AnyEvent-I3X-Workspace-OnDemand | WATERKIP | An I3 workspace loader | 2024-04-12T18:33:21 |
App-papersway | SPWHITTON | PaperWM-like window management for Sway/i3wm | 2024-04-12T08:18:00 |
App-sort_by_comparer | PERLANCAR | Sort lines of text by a Comparer module | 2024-04-16T00:06:00 |
App-sort_by_example | PERLANCAR | Sort lines of text by example | 2024-04-20T00:05:10 |
App-sort_by_sorter | PERLANCAR | Sort lines of text by a Sorter module | 2024-04-17T00:05:42 |
App-sort_by_sortkey | PERLANCAR | Sort lines of text by a SortKey module | 2024-04-24T00:06:38 |
Arithmetic-PaperAndPencil | JFORGET | simulating paper and pencil techniques for basic arithmetic operations | 2024-04-22T19:57:44 |
Bencher-Scenario-ExceptionHandling | PERLANCAR | Benchmark various ways to do exception handling in Perl | 2024-04-13T00:05:36 |
CPAN-Requirements-Dynamic | LEONT | Dynamic prerequisites in meta files | 2024-04-27T15:17:57 |
CSAF | GDT | Common Security Advisory Framework | 2024-04-23T21:49:42 |
CXC-DB-DDL | DJERIUS | DDL for table creation, based on SQL::Translator::Schema | 2024-04-04T16:24:13 |
Captcha-Stateless-Text | HIGHTOWE | stateless, text-based CAPTCHAs | 2024-04-17T21:19:21 |
Carp-Object | DAMI | a replacement for Carp or Carp::Clan, object-oriented | 2024-04-28T17:58:22 |
Carp-Patch-OutputToBrowser | PERLANCAR | Output stacktrace to browser as HTML instead of returning it | 2024-04-25T00:05:19 |
Catalyst-Plugin-Flash | ARISTOTLE | put values on the stash of the next request | 2024-04-09T05:06:19 |
Comparer-date_in_text | PERLANCAR | Compare date found in text (or text asciibetically, if no date is found) | 2024-04-18T00:05:43 |
Crypt-Passphrase-Bcrypt-Compat | LEONT | A bcrypt encoder for Crypt::Passphrase | 2024-04-08T14:24:10 |
DBD-Mock-Session-GenerateFixtures | UXYZAB | When a real DBI database handle ($dbh) is provided, the module generates DBD::Mock::Session data. Otherwise, it returns a DBD::Mock::Session object populated with generated data. This not a part form DBD::Mock::Session distribution just a wrapper around it. | 2024-04-29T18:25:02 |
Data-Dumper-UnDumper | BIGPRESH | load Data::Dumper output, including self-references | 2024-04-25T21:42:30 |
Data-MiniDumpX | PERLANCAR | A simplistic data structure dumper (demo for Plugin::System) | 2024-04-14T00:06:13 |
DateTime-Format-PDF | SKIM | PDF DateTime Parser and Formatter. | 2024-04-01T09:23:07 |
Devel-Confess-Patch-UseDataDumpHTMLCollapsible | PERLANCAR | Use Data::Dump::HTML::Collapsible to stringify reference | 2024-04-26T00:05:16 |
Devel-Confess-Patch-UseDataDumpHTMLPopUp | PERLANCAR | Use Data::Dump::HTML::PopUp to stringify reference | 2024-04-28T00:06:05 |
Dist-Build | LEONT | A modern module builder, author tools not included! | 2024-04-26T10:50:10 |
Dist-Zilla-Plugin-DistBuild | LEONT | Build a Build.PL that uses Dist::Build | 2024-04-26T10:55:35 |
Dist-Zilla-Plugin-DynamicPrereqs-Meta | LEONT | Add dynamic prereqs to to the metadata in our Dist::Zilla build | 2024-04-27T15:50:03 |
ExtUtils-Builder | LEONT | An overview of the foundations of the ExtUtils::Builder Plan framework | 2024-04-25T12:14:45 |
ExtUtils-Builder-Compiler | LEONT | Portable compilation | 2024-04-25T13:18:11 |
JSON-Ordered-Conditional | LNATION | A conditional language within an ordered JSON struct | 2024-04-06T06:47:37 |
JSON-ToHTML | ARISTOTLE | render JSON-based Perl datastructures as HTML tables | 2024-04-09T04:28:11 |
Knowledge | RSPIER | a great new dist | 2024-04-27T11:13:53 |
Log-Any-Simple | MATHIAS | A very thin wrapper around Log::Any, using a functional interface that dies automatically when you log above a given level. | 2024-04-24T19:51:03 |
Mo-utils-Country | SKIM | Mo country utilities. | 2024-04-11T13:41:33 |
Mo-utils-Time | SKIM | Mo time utilities. | 2024-04-12T14:28:06 |
Mo-utils-TimeZone | SKIM | Mo timezone utilities. | 2024-04-03T16:34:52 |
Mojolicious-Plugin-Authentication-OIDC | TYRRMINAL | OpenID Connect implementation integrated into Mojolicious | 2024-04-25T19:27:09 |
Mojolicious-Plugin-Cron-Scheduler | TYRRMINAL | Mojolicious Plugin that wraps Mojolicious::Plugin::Cron for job configurability | 2024-04-16T11:48:54 |
Mojolicious-Plugin-Migration-Sqitch | TYRRMINAL | Run Sqitch database migrations from a Mojo app | 2024-04-30T15:37:52 |
Mojolicious-Plugin-Module-Loader | TYRRMINAL | Automatically load mojolicious namespaces | 2024-04-19T14:09:36 |
Mojolicious-Plugin-ORM-DBIx | TYRRMINAL | Easily load and access DBIx::Class functionality in Mojolicious apps | 2024-04-03T13:32:06 |
Mojolicious-Plugin-SendEmail | TYRRMINAL | Easily send emails from Mojolicious applications | 2024-04-01T20:40:24 |
Mojolicious-Plugin-Sessionless | TYRRMINAL | Installs noop handlers to disable Mojolicious sessions | 2024-04-16T12:45:37 |
MooX-Pack | LNATION | The great new MooX::Pack! | 2024-04-20T01:52:17 |
Net-Async-OpenExchRates | VNEALV | Interaction with OpenExchangeRates API | 2024-04-20T11:46:28 |
Net-EPP-Server | GBROWN | A simple EPP server implementation. | 2024-04-08T09:38:21 |
Number-Iterator | LNATION | The great new Number::Iterator! | 2024-04-18T19:45:31 |
Parallel-TaskExecutor | MATHIAS | Cross-platform executor for parallel tasks executed in forked processes | 2024-04-13T20:02:27 |
Plack-App-Login-Request | SKIM | Plack application for request of login information. | 2024-04-29T14:23:02 |
Sah-SchemaBundle-Business-ID-BCA | PERLANCAR | Sah schemas related to BCA (Bank Central Asia) bank | 2024-04-23T00:05:53 |
Sah-SchemaBundle-Business-ID-Mandiri | PERLANCAR | Sah schemas related to Mandiri bank | 2024-04-30T00:05:43 |
Sah-SchemaBundle-Comparer | PERLANCAR | Sah schemas related to Comparer | 2024-04-21T00:05:30 |
Sah-SchemaBundle-Path | PERLANCAR | Schemas related to filesystem path | 2024-04-01T00:06:15 |
Sah-SchemaBundle-Perl | PERLANCAR | Sah schemas related to Perl | 2024-04-02T00:05:40 |
Sah-SchemaBundle-SortKey | PERLANCAR | Sah schemas related to SortKey | 2024-04-22T00:06:02 |
Sah-SchemaBundle-Sorter | PERLANCAR | Sah schemas related to Sorter | 2024-04-03T00:14:57 |
Sah-Schemas-Sorter | PERLANCAR | Sah schemas related to Sorter | 2024-04-03T00:05:43 |
Seven | LNATION | The great new Seven! | 2024-04-13T03:30:11 |
Sort-Key-SortKey | PERLANCAR | Thin wrapper for Sort::Key to easily use SortKey::* | 2024-04-04T00:05:05 |
SortExample-Color-Rainbow-EN | PERLANCAR | Ordered list of names of colors in the rainbow, in English | 2024-04-05T00:06:12 |
SortKey-Num-pattern_count | PERLANCAR | Number of occurrences of string/regexp pattern as sort key | 2024-04-06T00:05:41 |
SortKey-Num-similarity | PERLANCAR | Similarity to a reference string as sort key | 2024-04-08T00:05:21 |
SortKey-date_in_text | PERLANCAR | Date found in text as sort key | 2024-04-19T00:05:23 |
SortSpec | PERLANCAR | Specification of sort specification | 2024-04-09T00:05:37 |
SortSpec-Perl-CPAN-ChangesGroup-PERLANCAR | PERLANCAR | Specification to sort changes group heading PERLANCAR-style | 2024-04-10T00:05:24 |
Sorter-from_comparer | PERLANCAR | Sort by comparer generated by a Comparer:: module | 2024-04-11T00:05:17 |
Sorter-from_sortkey | PERLANCAR | Sort by keys generated by a SortKey:: module | 2024-04-12T00:05:58 |
Sqids | MYSOCIETY | generate short unique identifiers from numbers | 2024-04-06T10:43:27 |
TableData-Business-ID-BPOM-FoodAdditive | PERLANCAR | Food additives in BPOM | 2024-04-10T11:10:00 |
Tags-HTML-Image | SKIM | Tags helper class for image presentation. | 2024-04-20T13:32:39 |
Tags-HTML-Login-Request | SKIM | Tags helper for login request. | 2024-04-29T11:23:37 |
Test2-Tools-MIDI | JMATES | test MIDI file contents | 2024-04-09T23:42:34 |
Tiny-Prof | TIMKA | Perl profiling made simple to use. | 2024-04-26T07:19:38 |
Web-Async | TEAM | Future-based web+HTTP handling | 2024-04-23T16:50:24 |
YAML-Ordered-Conditional | LNATION | A conditional language within an ordered YAML struct | 2024-04-06T06:05:51 |
kraken | PHILIPPE | api.kraken.com connector | 2024-04-05T09:11:35 |
papersway | SPWHITTON | PaperWM-like window management for Sway/i3wm | 2024-04-12T07:52:39 |
Number of new CPAN distributions this period: 81
Number of authors releasing new CPAN distributions this period: 26
Authors by number of new CPAN distributions this period:
No | Author | Distributions |
---|---|---|
1 | PERLANCAR | 30 |
2 | TYRRMINAL | 7 |
3 | LEONT | 7 |
4 | SKIM | 7 |
5 | LNATION | 5 |
6 | MATHIAS | 2 |
7 | SPWHITTON | 2 |
8 | DJERIUS | 2 |
9 | ARISTOTLE | 2 |
10 | PHILIPPE | 1 |
11 | JFORGET | 1 |
12 | VNEALV | 1 |
13 | RSPIER | 1 |
14 | UXYZAB | 1 |
15 | WATERKIP | 1 |
16 | GBROWN | 1 |
17 | CORION | 1 |
18 | EGOR | 1 |
19 | TIMKA | 1 |
20 | TEAM | 1 |
21 | BIGPRESH | 1 |
22 | HIGHTOWE | 1 |
23 | DAMI | 1 |
24 | MYSOCIETY | 1 |
25 | JMATES | 1 |
26 | GDT | 1 |
submitted by /u/oalders [link] [comments] |
Published by con on Wednesday 01 May 2024 00:45
I have a file, tmp.pl, and wish to include my own perl module file, util.pm:
package util;
our @EXPORT = qw(execute);
sub execute {
my $cmd = shift;
my $return = 'exit';
my $die = 1;
if ($return !~ m/^(exit|stdout|stderr|all)$/i) {
die "you gave \$return = \"$return\", while this subroutine only accepts ^(exit|stdout|stderr)\$";
}
my ($stdout, $stderr, $exit) = capture {
system( $cmd )
};
if (($die == 1) && ($exit != 0)) {
say STDERR "exit = $exit";
say STDERR "STDOUT = $stdout";
say STDERR "STDERR = $stderr";
die "$cmd\n failed";
}
if ($return =~ m/^exit$/i) {
return $exit
} elsif ($return =~ m/^stderr$/i) {
chomp $stderr;
return $stderr
} elsif ($return =~ m/^stdout$/i) {
chomp $stdout;
return $stdout
} elsif ($return =~ m/^all$/i) {
chomp $stdout;
chomp $stderr;
return {
exit => $exit,
stdout => $stdout,
stderr => $stderr
}
} else {
die "$return broke pigeonholes"
}
return $stdout
}
1;
which I include in the current directory thus:
#!/usr/bin/env perl
use Cwd 'getcwd';
push @INC, getcwd();
use util;
use warnings FATAL => 'all';
use autodie ':default';
which gives me an error:
Can't locate util.pm in @INC (you may need to install the util module) (@INC entries checked:
How can I include the simple module in a directory with other scripts?
Welcome to “What’s new on CPAN”, a curated look at last month’s new CPAN uploads for your reading and programming pleasure. Enjoy!
perldeprecation: clean up - Remove duplicate sections: File::Glob::glob, bare { in regexes, code points above 0xFF in string bitwise ops These were repeated for different perl versions, but none of the other sections list deprecations and removal separately (e.g. "Passing malformed strings was deprecated in Perl 5.18, and became fatal in Perl 5.26" only appears under Perl 5.26; the deprecation is not listed separately under Perl 5.18). - Fix some typos (e.g. "ballanced") - Fix (?) some grammar/punctuation Also use past tense to describe removed functions. - Fix some POD markup (C< > around variables, L< > for modules)
I've just returned from two weeks of traveling from Lisbon through the south of Spain to Barcelona. It's a beautiful country. I wish that for just one time you could stand inside my shoes. The trip was a bit too rushed (Lisbon: check; Cordoba: check; Grenada: check, Seville: check, ...). I could happily return to any of them for a week.
But the best part is coming home to a backlog of Weekly Challenges!
You are given an array of @ints. Write a script
to find the sign of product of all integers in
the given array. The sign is 1 if the product
is positive, -1 if the product is negative and
0 if the product is zero.
@ints = (-1, -2, -3, -4, 3, 2, 1)
1
@ints = (1, 2, 0, -2, -1)
0
@ints = (-1, -1, 1, -1, 2)
-1
Simple problem, but there several ways to approach it. We could do as the examples suggest and multiply it out. No, I do not feel that good when I see the integer overflow that could occur.
Because math, we know that it will be zero if any number in the list is zero, and it will be negative if there are an odd number of negative elements in the list. We could walk over the list, counting negatives and bailing out if we find a zero.
But I just want to be on the side that's winning, and there's Perl, offering up the tri-valued <=>
operator. Comparing a number to 0 will hand us -1, 0, or 1 -- just what we need.
sub prodSign(@ints)
{
my $sign = 1;
while ( $sign && defined(my $n = shift @ints) )
{
$sign *= ($n <=> 0);
}
return $sign;
}
The while
loop is a cute Perl idiom for traversing a list. We eat up the first element in each iteration; it will eventually return undef
when nothing is left.
The first condition of the while
loop ($sign
) will end the loop if the product becomes zero -- a possible optimization. You say you lost your faith that there would be premature optimization? You had no faith to lose, and you know it.
You are given a string, $str, and a 26-items
array @widths containing the width of each
character from a to z. Write a script to find
the number of lines and the width of the last
line needed to display the given string, assuming
you can only fit 100 width units on a line.
$str = "abcdefghijklmnopqrstuvwxyz"
@widths = (10,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10)
(3, 60)
$str = "bbbcccdddaaa"
@widths = (4,10,10,10,10,10,10,10,10,10,10,10,10,
10,10,10,10,10,10,10,10,10,10,10,10,10)
(2, 4)
Some of these characters are going to have to move to other lines. And now I know you're dissatisfied with your position and your place, but don't you understand that's not my problem? The only problem is to figure out how long the last line is.
We don't even care what the lines actually contain. We can just replace every character with its width, and find groups of 100 or less until we're done.
So let's Perl it up. First, some minimal data integrity. Let's make sure our string really only contains valid characters by converting to lowercase, and deleting any characters that aren't 'a' through 'z'.
$str = lc $str;
$str =~ s/[^a-z]//g;
Then, we have a couple of things that are constants: the line width of 100, and the beginning of the alphabet.
use constant { MAXLINE => 100,
ORD_A => ord('a')
};
We're taking the easy way out here, assuming ASCII characters. The ord
function gives us the numeric value of a character (although everybody knows that 'a' is 0x61 —- highway 61 revisited?), which will give us offsets into the @widths
table. We could be a little more robust by turning the @widths
table into a hash lookup for a
through z
, but not today. You say I let you down; you know it's not like that. You know as well as me you'd rather see it optimized.
To replace the characters with their widths, we'll split the string into individual characters and replace them with a width from the @widths
array.
my @cw = map { $widths[ ord($_) - ORD_A ] } split(//, $str);
Now we consume that list of widths, starting a new line every time we reach 100.
my $lineCount = 1;
my $width = 0;
while ( defined(my $w = shift @cw) )
{
if ( $width + $w <= MAXLINE )
{
$width += $w;
}
else
{
$width = $w;
$lineCount++;
}
}
return [ $lineCount, $width ];
Published by khwilliamson on Tuesday 30 April 2024 14:12
Update pod for Perl_form() and kin This fixes GH #22170, and includes several corrections.
Published by tonycoz on Monday 29 April 2024 23:53
hints/dragonfly.sh: actually disable the POSIX 2008 locale API ae3e9dd0b was intended to disable this API, due to a leak in the DragonflyBSD implementation, but the wrong macro was used, which I missed in review. Use the right macro.
Published by Ted James on Monday 29 April 2024 07:12
Published by DragosTrif on Monday 29 April 2024 06:43
A while ago I discovered DBD::Mock
and it looked like a great tool to use in Perl unit tests. However the challenge of generating the fixtures was not always easy.
In order to solve this issue I have put together a small library that should help generate the fixture data needed.
At the core this very simple, I have mocked DBI
subs in order to capture the necessary information and stored it into a file:
The first step was to generate an override object and store it on $self
:
package DBD::Mock::Session::GenerateFixtures;
use Sub::Override;
...
our $override = Sub::Override->new();
sub new {
$self->{override} = $override;
}
Then we can use this to mock DBI
code like in the following example:
sub _override_dbi_execute {
my $self = shift;
my $dbi_execute = shift;
my $orig_execute = \&$dbi_execute;
$self->get_override_object()->replace(
$dbi_execute,
sub {
my ($sth, @args) = @_;
my $sql = $sth->{Statement};
my $col_names = $sth->{NAME};
my $retval = $orig_execute->($sth, @args);
my $rows = $sth->rows();
my $query_data = {
statement => $sql,
bound_params => \@args,
col_names => $col_names,
};
my $result = [];
if ($rows > 0) {
foreach my $row (1 .. $rows) {
push @{$result}, [];
}
$query_data->{results} = $result;
}
$query_data->{bound_params} = $self->{bind_params}
if scalar @{$self->{bind_params}} > 0;
push @{$self->{result}}, $query_data;
$self->_write_to_file();
$self->{bind_params} = [];
$self->{sth} = $sth;
return $retval;
}
);
return $self;
}
This code works for do
or prepare
and execute
when you are trying to mock insert, update or delete statements like is this example:
subtest 'upsert generate mock data' => sub {
my $dbh = db_handle('test.db');
build_tests_db($dbh);
populate_test_db($dbh);
my $obj = DBD::Mock::Session::GenerateFixtures->new({dbh => $dbh});
$dbh = $obj->get_dbh();
my $sql_license = <<"SQL";
INSERT INTO licenses (name, allows_commercial) VALUES ( ?, ? )
SQL
chomp $sql_license;
my $r = $dbh->do($sql_license, undef, 'test_license', 'no');
is($r, 1, 'one row inserted is ok');
my $update_sql = 'update licenses set allows_commercial = ? where id > ?';
$r = $dbh->do($update_sql, undef, 'yes', '3');
is($r, 2, 'update works ok');
$r = $dbh->do($update_sql, undef, 'yes', '100');
is($r, '0E0', 'now rows updated');
my $delete_sql = 'DELETE FROM licenses WHERE id = ?';
my $sth = $dbh->prepare($delete_sql);
$sth->execute(3);
is($sth->rows(), 1, 'delete with prepare and execute is ok');
$obj->restore_all();
$dbh->disconnect();
};
The the following data is stored in a Json
file:
[
{
"statement" : "INSERT INTO licenses (name, allows_commercial) VALUES ( ?, ? )",
"results" : [
[]
],
"col_names" : [],
"bound_params" : [
"test_license",
"no"
]
},
{
"bound_params" : [
"yes",
"3"
],
"statement" : "update licenses set allows_commercial = ? where id > ?",
"col_names" : [],
"results" : [
[],
[]
]
},
{
"col_names" : [],
"statement" : "update licenses set allows_commercial = ? where id > ?",
"bound_params" : [
"yes",
"100"
]
},
{
"statement" : "DELETE FROM licenses WHERE id = ?",
"col_names" : [],
"results" : [
[]
],
"bound_params" : [
3
]
}
]
Please observe how the results key is populate with an empty array for each row touched by our statement and it is ready to be used when a DBD::Mock::Session object is built.
For select statements you need a extra layer of mocking in order to store the exact values a select could use.
Here is how the mock for fetchrow_hashref
looks like:
sub _override_dbi_fetchrow_hashref {
my $self = shift;
my $fetchrow_hashref = shift;
my $orig_selectrow_hashref = \&$fetchrow_hashref;
$self->get_override_object()->replace(
$fetchrow_hashref,
sub {
my ($sth) = @_;
my $retval = $orig_selectrow_hashref->($sth);
if (ref $retval) {
my $query_results = $self->_set_hashref_response($sth, $retval);
push @{$self->{result}->[-1]->{results}}, $query_results;
$self->_write_to_file();
}
return $retval;
}
);
return $self;
}
This produces the following data by pushing the each row in the result key:
[
{
"statement" : "SELECT * FROM media_types WHERE id IN(?,?)",
"col_names" : [
"id",
"media_type"
],
"results" : [
[
1,
"video"
],
[
2,
"audio"
]
],
"bound_params" : [
2,
1
]
}
]
Form this point one I just need to make sure that every way in which DBI lets you get the data is covered by my code. In the end I end it mocking the following subs:
Readonly::Hash my %MOCKED_DBI_METHODS => (
execute => 'DBI::st::execute',
bind_param => 'DBI::st::bind_param',
fetchrow_hashref => 'DBI::st::fetchrow_hashref',
fetchrow_arrayref => 'DBI::st::fetchrow_arrayref',
fetchrow_array => 'DBI::st::fetchrow_array',
selectall_arrayref => 'DBI::db::selectall_arrayref',
selectall_hashref => 'DBI::db::selectall_hashref',
selectcol_arrayref => 'DBI::db::selectcol_arrayref',
selectrow_array => 'DBI::db::selectrow_array',
selectrow_arrayref => 'DBI::db::selectrow_arrayref',
selectrow_hashref => 'DBI::db::selectrow_hashref',
);
If you want to give this a try you can get the full code from this url:
DBD-Fixtures
Originally published at Perl Weekly 666
Hi there,
As we all know, German Perl/Raku Workshop 2024 happend few weeks ago, it turned out to be lucky for LPW 2024. After GPW, we got the official announcement of LPW 2024. It is going to be one day event as per the tradition. The tentative date as of today is 26th October 2024 and it is Saturday. If you are FREE then don't forget to plan your visit in advance. It is returning after a gap of 5 years. It would be a special event for one more reason as it would be the 20th anniversay in terms of years. I am very happy to see the support we already got. Dave Cross shared the news that he has submitted 4 talks already. If you are planning to attend then please submit your talk as well. LPW always encourage first time speakers. If you can't make it full length talk then you can even submit 5 minutes lightning talk. To my surprise, as soon as the annoucement was public, Geekuni became the Silver Sponsor. Ofcourse, we are looking for more sponsors. If your workplace codebase uses Perl then I would suggest you please speak to the management if they are willing to sponsor the event. You can find more details about different sponsor packages.
There is another big event happening in Las Vegas and it is The Perl and Raku Conference from 24-28 June 2024. The event organisers made a Call for Volunteers. I had plan to attend the event with family as it is happening in Las Vegas. Now the circumstance is such that even my own visit is not confirmed. It would be a big loss if I don't make it to Las Vegas this time.
Do you remember the last major release of Perl v5.38? It was special because of the inclusion of Corinna. I am hoping, in the next release Perl v5.40, we get more features added to Corinna. According to this document, the tentative release date is 20th May 2024.
The post series What's new on CPAN ... on perl.com is my all time favourite. Recently it got fresh air and we had 4 in a row e.g. Nov 23, Dec 23, Jan 24 and Feb 24. It is nearly end of Apr 24 and we have not seen the post for Mar 24. I just hope and wish, the tradition doesn't die. I am keeping my fingers crossed.
Last but not least, you please take a good care of yourself and your loved ones. Enjoy the rest of the newsletter.
--
Your editor: Mohammad Sajid Anwar.
Event like TPRC is only possible because of volunteers who give their time and expertise to plan, promote, and execute every detail. This is official call for volunteers!
Please register and submit talks early - it would organiser better idea of numbers. The date is tentative, depending on the venue, but it is likely to be 26th October 2024.
Perl Steering Council shared the details of last meetup. For me the most important news is about the preparation for next release Perl v5.40.
Leo shares his contribution details of Day 1 of PTS 2024.
The Weekly Challenge by Mohammad Sajid Anwar will help you step out of your comfort-zone. We pick one champion at the end of the month from among all of the contributors during the month.
Welcome to a new week with a couple of fun tasks "Product Sign" and "Line Counts". If you are new to the weekly challenge then why not join us and have fun every week. For more information, please read the FAQ.
Enjoy a quick recap of last week's contributions by Team PWC dealing with the "Uncommon Words" and "X Matrix" tasks in Perl and Raku. You will find plenty of solutions to keep you busy.
A very compact and elegant solutions in Perl. Thanks for sharing.
I love when the scope is extended and you get far more creative solutions in Raku. Highly recommended.
This is a perfect gift for all Raku fans. Great discussion of every features used in the solution. You really don't want to skip it.
I am really amazed by the use of 'singleton' to get the job done. You also get to see PDL magic as well. Well done and keep it up.
Full of Raku magics with detailed discussion. You get the bonus solution in Perl too. Thanks for sharing.
Showing off the fancy use of True and False of Raku. Also checkout how this is implemented in Perl. Keep it up great work.
Raku special feature of method chaining is taking the limelight. Raku Rocks !!!
As always, we get another one-liner in Perl. Perl fans wouldn't want to skip it. Well done and keep it up great work.
This is my favourite where I get to learn something new every week. Happy to see the inspiration within the team. Keep it up great work.
Love the simplicity in the solution. No gimmicks, pure solution. Get to try as well, really cool. Thanks for sharing.
Easy to follow and read solutions in Perl. Keep it up great work.
I like the use of 'fc' and handling of apostrophes is really cool. Highly recommended.
Roger special blogging style is fun to follow as you get to see the discussion in breaks. You get to see more than one language in a post. Highly recommended.
Simon is a Python fan apparently as he always discuss his Python solution in the blog post every week. Thanks for sharing.
Great CPAN modules released last week;
MetaCPAN weekly report;
StackOverflow Perl report.
You joined the Perl Weekly to get weekly e-mails about the Perl programming language and related topics.
Want to see more? See the archives of all the issues.
Not yet subscribed to the newsletter? Join us free of charge!
(C) Copyright Gabor Szabo
The articles are copyright the respective authors.
Each week Mohammad S. Anwar sends out The Weekly Challenge, a chance for all of us to come up with solutions to two weekly tasks. My solutions are written in Python first, and then converted to Perl. It's a great way for us all to practice some coding.
You are given two sentences, $line1
and $line2
.
Write a script to find all uncommmon words in any order in the given two sentences. Return ('')
if none found.
A word is uncommon if it appears exactly once in one of the sentences and doesn’t appear in other sentence.
For this task, I took word to mean things separated by spaces. This is rather simplified of a real world sentence, which usually would be terminated by a punctuation character. I also don't convert the characters to a single case. Therefore 'Mango' and 'mango' would be considered different words.
With that in mind, I calculate the frequency of each word and return words that only occur once. In Python 3.7 or greater, the list will be in the order that they appear. In older Python and Perl, the list order is not deterministic.
While the task specifies two sentences, this script can take as many lines as desired.
def uncommon_words(*strings) -> list:
for string in strings:
for word in string.split(' '):
freq[word] += 1
return [w for w in freq if freq[w] == 1]
$ ./ch-1.py "Mango is sweet" "Mango is sour"
('sweet', 'sour')
$ ./ch-1.py "Mango Mango" "Orange"
('Orange')
$ ./ch-1.py "Mango is Mango" "Orange is Orange"
('')
You are given a square matrix, $matrix
.
Write a script to find if the given matrix is X Matrix.
A square matrix is an X Matrix if all the elements on the main diagonal and antidiagonal are non-zero and everything else are zero.
For this task, I take the input as a JSON array. The first step I take is to check that the array is square. Each column must have the same number of integers as the number of rows.
rows = len(matrix)
for row in range(rows):
if len(matrix[row]) != rows:
raise ValueError("Please specify a square matrix")
I then check that every cell is the correct values (non-zero for the cross diagonal or zero otherwise). For a give row
(0 to one less than the length of the square), a non zero value is required for column row
or rows - 1 - row
. I return False
as soon as the an invalid value is found.
If all cells have the correct value, I return True
.
for row in range(rows):
for col in range(rows):
if col == row or col == rows - 1 - row:
if matrix[row][col] == 0:
return False
elif matrix[row][col] != 0:
return False
return True
$ ./ch-2.py "[ [1, 0, 0, 2], [0, 3, 4, 0], [0, 5, 6, 0], [7, 0, 0, 1] ]"
true
$ ./ch-2.py "[ [1, 2, 3], [4, 5, 6], [7, 8, 9] ]"
false
$ ./ch-2.py "[ [1, 0, 2], [0, 3, 0], [4, 0, 5] ]"
true
Published by Unknown on Sunday 28 April 2024 09:07
Published by Unknown on Sunday 28 April 2024 09:05
This is the weekly favourites list of CPAN distributions. Votes count: 75
Week's winner (+4): App::perlimports
Build date: 2024/04/28 07:04:22 GMT
Clicked for first time:
Increasing its reputation:
These are the five most rated questions at Stack Overflow last week.
Between brackets: [question score / answers count]
Build date: 2024-04-28 07:03:15 GMT
Published by Amber Krawczyk on Saturday 27 April 2024 11:36
We hope you are coming to [The Perl and Raku Conference[(https://tprc.us/) in Las Vegas June 24-28! Plans are underway for a wonderful TPRC. But a conference of this type is only possible because of volunteers who give their time and expertise to plan, promote, and execute every detail. We need volunteers! You may have already volunteered to speak at the conference; if so, wonderful! If you are not presenting (or even if you are), there are many ways to help. We need people to set up and take down, to run the registration desk, to serve as room monitors, to help record the talks, and to just be extra hands. If you can spare some of your time for the sake of the conference, please fill out a volunteer form at https://tprc.us/tprc-2024-las/volunteer/ . We also welcome spouses and friends of attendees who might be coming along to Las Vegas to share the experience. We are offering TPRC "companion" tickets, for access to the social parts of the conference (food, drink, parties) but not the technical. Volunteers of at least one complete day, who sign up before the conference, will have companion access "comped". If you have questions about volunteering, please contact our TPRC Volunteer Coordinator: Sarah Gray sarah.gray@pobox.com
Published by Saif Ahmed on Friday 26 April 2024 15:18
Another Grant Application from a key Raku develoer, Stefan Seifert. A member of the Raku Steering Council, Stefan is also an author of several Perl 5 modules including Inline::Python and (of course) Inline::Perl6. This Grant is to help advance AST or Abstract Syntax Tree. This is integral to Raku internals and allows designing and implementation of new language components, that can be converted into bytecode for execution by the interpreteter or "virtual machine" more easily that trying to rewrite the interpretter. Here is an excellent intro by Elizabeth Mattijsen
There is a grant called RakuAST granted to Johnathan Worthington that is still listed as running. Sadly Johnathan has moved on and is no longer actively developing the Rakudo core. However the goal of his grant is still worthy as it is one of the strategic initiatives providing numerous benefits to the language. I have in fact already taken over his work on RakuAST and over the last two years have pushed some 450+ commits which led to hundreds of spectests to pass. This work was done in my spare time which was possible because I had a good and reliable source of income and could at times sneak in some Raku work into my dayjob. I can no longer claim that Raku is in any way connected to my day job and time invested in Raku comes directly out of the pool that should ensure my financial future. In other words, there's a real cost for me and I'd like to ask for this to be offset by way of a grant.
This is mostly directly taken from the RakuAST grant proposal as the goal stays the same:
An AST can be thought of as a document object model for a programming language. The goal of RakuAST is to provide an AST that is part of the Raku language specification, and thus can be relied upon by the language user. Such an AST is a prerequisite for a useful implementation of macros that actually solve practical problems, but also offers further powerful opportunities for the module developer. For example:
RakuAST will also become the initial internal representation of Raku programs used by Rakudo itself. That in turn gives an opportunity to improve the compiler. The frontend compiler architecture of Rakudo has changed little in the last 10 years. Naturally, those working on it have learned a few things in that time, and implementing RakuAST provides a chance to fold those learnings into the compiler. Better static optimization, use of parallel processing in the compiler, and improvements to memory and time efficiency are all quite reasonable expectations. We have already seen that the better internal structure fixes a few long standing bugs incidentally. However, before many of those benefits can be realized, the work of designing and implementing RakuAST, such that the object model covers the entire semantic and declarational space of the language, must take place. This grant focuses on that work.
Considering the amount of work these items already will be, I would specifically exclude work targeted at synthetic AST generation, designs for new macros based on this AST, and anything else that is not strictly necessary to reach the goal of the RakuAST compiler frontend becoming the default.
For the test and spectest suites I would continue my tried and proven model of picking the next failing test file and making fixes until it passes. Based on current velocity this will take around 6 months. However there's hope that some community members will return from their side projects and chime in.
I have been involved in Rakudo development since 2014 when I started development of Inline::Perl5 which brings full two-way interoperability between Raku and Perl. Since then I have helped with every major effort in Rakudo core development like the Great List Refactor, the new dispatch mechanism and full support for unsigned native integers. I have fixed hundreds of bugs in MoarVM including garbage collection issues, race conditions and bugs in the specializer. I have made NativeCall several orders of magnitude faster by writing a special dispatcher and support for JIT compiling native calls. I replaced a slow and memory hungry MAST step in the compilation process by writing bytecode directly, have written most of Rakudo's module loading and repository management code and in general have done everything I could to make Rakudo production worthy. I have also been a member of the Raku Steering Council since its inception.
Elizabeth Mattijsen, Geoffrey Broadwell, Nick Logan, Richard Hainsworth
Published by Gabor Szabo on Thursday 25 April 2024 08:46
I bumped into the GitHub profile of Giuseppe Di Terlizzi (giterlizzi) while doing my research for the other series I run about GitHub Sponsors:
I wanted to see if there are Perl developers who receive money via GitHub profiles. So I went to the recent CPAN releases page on the CPAN Digger and visited the GitHub account of the authors of the most recent releases. That's how I bumped into GDT.
The new thing I saw in his profile was a graph generated by CodersRank that shows the distribution of languages he used throughout the years.
I jumped on the opportunity and created an account so I'll also have such a nice graph, but there was an error while creating my account. So I can't see that graph yet. 😞
Let's use this opportunity and recommend you to sponsor Giuseppe.
At the Koha Hackfest I had several discussions with various colleagues about how to improve the way plugins and hooks are implemented in Koha. I have worked with and implemented various different systems in my ~25 years of Perl, so I have some opinions on this topic.
When you have some generic piece of code (eg a framework or a big application that will be used by different user groups (like Koha)), people will want to add custom logic to it. But this custom logic will probably not make sense to every user. And you probably don't want all of these weird adaptions in the core code. So you allow users to write their weird adaptions in Plugins, which will be called via Hooks in the core code base. This patter is used by a lot of software, from eg mod_perl/Apache, Media Players to JavaScript frontend frameworks like Vue.
Generally, there are two kinds of Hook philosophies: Explicit Hooks, where you add explicit calls to the hook to the core code; and Implicit Hooks, where some magic is used to call Plugins.
Explicit Hooks are rather easy to understand and implement:
package MyApp::Model::SomeThing;
method create ($args) {
$self->call_hook("pre_create", $args);
my $item = $self->resultset("SomeThing")->create( $args );
$self->call_hook("post_create", $args, $item);
return $item;
}
So you have a method create
which takes some $args
. It first calls the pre_create
hook, which could munge the $args
. Then it does what the Core implementation wants to do (in this case, create a new item in the database). After that it calls the post_create
hook which could do further stuff, but now also has the freshly created database row available.
The big advantage of explicit hooks is that you can immediately see which hook is called when & where. The downside is of course that you have to pepper your code with a lot of explicit calls, which can be very verbose, especially once you add error handling and maybe a way for the hook to tell the core code to abort processing etc. Our nice, compact and easy to understand Perl code will end up looking like Go code (where you have to do error handling after each function call)
Implicit hooks are a bit more magic, because the usually do not need any adaptions to the core code:
package MyApp::Model::SomeThing;
method create ($args) {
my $item = $self->resultset("Foo")->create( $args );
return $item
}
There are lots of ways to implement the magic needed.
One well-known one is Object Orientation, where you can "just" provide a subclass which overrides the default method. Of course you will then have to re-implement the whole core method in your subclass, and figure out a way to tell the core system that it should actually use your subclass instead of the default one.
Moose allows for more fine-grained ways to override methods with it's method modifiers like before
, after
and around
. If you also add Roles to the mix (or got all in with Parametric Roles) you can build some very abstract base classes (similar to Interfaces in other languages) and leave the actual implementation as an exercise to the user...
Coincidentally, at the German Perl Workshop Ralf Schwab presented how they used AUTOLOAD
and a hierarchy of shadow classes to add a Plugin/Hook system to their Cosmo web shop (which seems to be also wildly installed and around for quite some time). (I haven't seen the talk, only the slides
I have some memories (not sure if fond or nightmarish) of a system I build between 1998 and 2004 which (ab)used the free access Perl provides to the symbol table to use some config data to dynamically generate classes, which could then later by subclassed for even more customization.
But whatever you use to implement them, the big disadvantage of Implicit Hooks is that it is rather hard to figure out when & why each piece of code is called. But to actually and properly use implicit hooks, you will also have to properly structure your code in your core classes into many small methods instead of big 100-line monsters, which also improves testabilty.
Generally, "it depends". But for Koha I think Explicit Hooks are better:
next
or SUPER
) might be a bit to much for some Plugin authors (who might be more on the librarian-who-can-code-a-bit side of the spectrum then on dev-who-happens-to-work-with-libraries)boring > magic
!Using implicit hooks could maybe make sense if Koha
around
in Moose, error handling, ...).An while it itches me in the fingers to do come up with such a smart system, I think currently dev time is better spend on other issues and improvements.
P.S.: I'm currently traveling trough Albania, so I might be slow to reply to any feedback.
Published by Unknown on Sunday 21 April 2024 13:58
Published on Friday 19 April 2024 07:00
Last week we (aka HKS3) attended the Koha Hackfest in Marseille, hosted by BibLibre. The hackfest is a yearly meeting of Koha developers and other interested parties, taking place since ~10 years in Marseille. For me, it was the first time!
git-bz
.--dbshell
to KTD for easy access to the DB shell.Thanks to BibLibre and Paul Poulain for organizing the event, and to all the attendees for making it such a wonderful 4 days!
Published by Saif Ahmed on Thursday 18 April 2024 16:50
We have had a grant aplication from Jason Crome. He is an author and maintainer of a very popular Perl Web Framework familiar to many of us in the Perl community. Dancer 2 has continued to evolve and remains very useful for web application creation. As it besomes more modernised, more robust, and acquired more new features, it has become out of sync with available documentation. A key requirement to realise the usefulness of any project is the availability of resources that enable its use. This includes up to date documents and representative examples.
Improve the overall quality of the Dancer2 documentation, and ensurethat documentation is up-to-date with recent developments of Dancer2. Create a sample application that follows current Dancer2 standards.
The Dancer Core Team ran a survey of its community in 2017, and one of the items that stood out most was documentation. 33% of our users like our documentation, 33% are ambivalent, and 33% dislike it. Clearly, that leaves a lot of room for improvement, and sadly, the state of our docs hasn't changed much since then.
As reference material, the Dancer2 docs are adequate, but many core concepts are not explained well or at all. Dancer2 is easy to get going with, but the documentation doesn't do the best job of illustrating this. Enhanced documentation is not only good for seasoned users of Perl andDancer2, but also lowers the barrier to entry for less experienced developers, or developers who are new to building web applications.
The example application is also a bit of a mess; we've had to patch it several times to make it correctly work, and it doesn't adhere to current standards in places. This example should serve as a model of what a quality Dancer2 app looks like while being a good learning tool. We don't feel it does either of these well.
We leaned on a tech writer to review our docs, and they provided a list of suggestions and enhancements to make Dancer2's documentation friendlier and more approachable, and these suggestions form the basis of this grant.
This grant will run for four months, and is organized into the following segments:
Dancer2::Manual
revampThe most intense work of this grant will happen during this first segment. The core of the manual will be restructured, revised, and improved. The manual will be structured such that it will first emphasize how easy it is to build applications with Dancer2 and explain the fundamental concepts of building Dancer2 applications:
From there, the manual will layer on additional concepts, each building on each other. These sections will align with tasks that developers will want to accomplish with their Dancer2 apps:
Dancer2::Manual
The primary task in month 3 is to rebuild the example application such that it uses all modern techniques and standards for Dancer2 applications. It should be well-written and documented to be the best learning tool it can be.
Much of the review and editing of the core manual will happen during this time.
In the last segment of this grant, we'll review the cookbook and deployment guide to ensure they are in the best possible shape. Outdated information will be updated or pruned; up to date examples will be added to the deployment guide (Docker/containerization, Caddy, etc.). The cookbook will be enhanced with new suggestions and recipes, and the migration guide will be freshened up.
Any remaining time will be used for any final edits that are needed for this grant can be considered complete.
I'm Jason Crome, though you may know me as CromeDome (my CPAN handle). I've been around the Perl community for the better part of 20 years, and was an active member of the CGI::Application community before becoming a Dancer Core Developer in 2015. I've served on the TPRF Grants Committee, first as a voting member and later as its secretary. I'm the organizer of Charlotte Perl Mongers, and I like puppies and long walks in the park.
I've been the release manager for Dancer2 for the last 5+ years, and the loudest/most publicly outspoken member of our community during that time. I'm constantly in contact with our community, and no one knows our community quite as well as I do. My extensive knowledge of both the framework and our community makes me the ideal candidate for this work. And when I need help or get blocked, I know exactly who to bring in to help things get going again.
$2,800 USD, with half paid two months in, the balance paid upon completion.
There may be others involved in the writing and editing of the updated docs; if so, I would coordinate the work and issue any payments to these parties out of payments I receive from TPF. This would be my burden to manage; the interface on this project would be between me and the selected grant manager.
Published by Todd Rinaldo on Tuesday 16 April 2024 17:17
The Perl and Raku Conference is fast approaching! We will be in Las Vegas from June 24 to 28 (the main conference is from June 25 to 27).
We want more speakers, so we are reopening the full call for talks/papers/posters. The new deadline is April 20, midnight Las Vegas time (April 21 00:00 UTC). Now that the national eclipse is not a distraction, please consider submitting a talk (50 minute, or 20 minute) or a scientific paper or poster before the new deadline! Speakers will be informed of talk acceptance by April 30.
Talks of 20 minutes or 50 minutes, papers, and posters earn the presenter free admission. Giving a Lightning Talk does not reduce the admission fee but earns our appreciation and delight!
Whether speaker or attendee, we look forward to seeing you in Las Vegas!
Published by Unknown on Sunday 14 April 2024 10:03
Published by perlancar on Sunday 14 April 2024 00:11
dist | author | abstract | date |
---|---|---|---|
AI-Chat | BOD | Interact with AI Chat APIs | 2024-03-02T22:12:10 |
AI-Image | BOD | Generate images using OpenAI's DALL-E | 2024-03-06T23:01:10 |
Acme-CPANModules-LoadingModules | PERLANCAR | List of modules to load other Perl modules | 2024-03-01T00:06:07 |
Acme-CPANModules-LoremIpsum | PERLANCAR | List of modules related to "Lorem Ipsum", or lipsum, placeholder Latin text | 2024-03-02T00:05:10 |
Acme-CPANModules-OpeningFileInApp | PERLANCAR | List of modules to open a file with appropriate application | 2024-03-04T00:05:56 |
Acme-CPANModules-RandomText | PERLANCAR | List of modules for generating random (placeholder) text | 2024-03-05T00:05:27 |
Acme-TaintTest | SIDNEY | module for checking taint peculiarities on some CPAN testers | 2024-03-25T09:22:24 |
Alien-Pipx | CHRISARG | Provides the pipx Python Package Manager | 2024-03-09T13:19:11 |
Alien-Qhull | DJERIUS | Build and Install the Qhull library | 2024-03-06T18:15:57 |
Alien-SeqAlignment-MMseqs2 | CHRISARG | find, build and install the mmseqs2 tools | 2024-03-24T03:33:13 |
Alien-SeqAlignment-bowtie2 | CHRISARG | find, build and install the bowtie2 tools | 2024-03-19T12:31:34 |
Alien-SeqAlignment-cutadapt | CHRISARG | Provide the cutadapt utility for eliminating polyA tails through pipx | 2024-03-09T04:49:02 |
Alien-SeqAlignment-hmmer3 | CHRISARG | find, build and install the hmmer3 tools | 2024-03-22T03:29:12 |
Alien-SeqAlignment-last | CHRISARG | find, build and install the last tools | 2024-03-16T21:16:36 |
Alien-SeqAlignment-minimap2 | CHRISARG | A Perl wrapper for the minimap2 binary executables | 2024-03-23T00:58:56 |
Alien-pipx | CHRISARG | Provides the pipx Python Package Manager | 2024-03-08T20:39:35 |
Amazon-Sites | DAVECROSS | A class to represent Amazon sites | 2024-03-20T16:18:39 |
App-BPOMUtils-RPO-Ingredients | PERLANCAR | Group ingredients suitable for food label | 2024-03-10T00:05:30 |
App-CSVUtils-csv_mix_formulas | PERLANCAR | Mix several formulas/recipes (lists of ingredients and their weights/volumes) into one, and output the combined formula | 2024-03-03T00:06:02 |
App-ComparerUtils | PERLANCAR | CLIs related to Comparer | 2024-03-06T00:05:48 |
App-DWG-Sort | SKIM | Tool to sort DWG files by version. | 2024-03-06T10:03:07 |
App-SortExampleUtils | PERLANCAR | CLIs related to SortExample | 2024-03-07T00:05:25 |
App-SortKeyUtils | PERLANCAR | CLIs related to SortKey | 2024-03-08T00:05:47 |
App-SortSpecUtils | PERLANCAR | CLIs related to SortSpec | 2024-03-09T00:05:07 |
App-SorterUtils | PERLANCAR | CLIs related to Sorter | 2024-03-11T00:05:26 |
App-SpreadsheetOpenUtils | PERLANCAR | Utilities related to Spreadsheet::Open | 2024-03-12T00:05:23 |
App-cat-v | UTASHIRO | cat-v command implementation | 2024-03-31T10:58:40 |
App-chartimes | TULAMILI | 2024-03-15T01:18:20 | |
App-colcount | TULAMILI | 各行について、カラムの数を数えたり、条件を満たすカラムの数を数えたりする。 | 2024-03-15T10:32:37 |
App-ctransition | TULAMILI | 入力の全ての文字に対して、次の文字は何であるかの回数の集計を、行列状に表示する。 | 2024-03-15T12:58:49 |
App-samelines | TULAMILI | 2024-03-14T07:49:49 | |
Bencher-Scenario-ListFlattenModules | PERLANCAR | Benchmark various List::Flatten implementaitons | 2024-03-13T00:05:28 |
Bencher-Scenarios-Text-Table-Sprintf | PERLANCAR | Scenarios for benchmarking Text::Table::Sprintf | 2024-03-14T00:05:21 |
Bio-SeqAlignment | CHRISARG | Aligning (and pseudo aligning) biological sequences | 2024-03-24T01:05:16 |
Business-Tax-US-Form_1040-Worksheets | JKEENAN | IRS Form 1040 worksheets calculations | 2024-03-20T19:16:50 |
CXC-Data-Visitor | DJERIUS | Invoke a callback on every element at every level of a data structure. | 2024-03-23T17:04:24 |
Carp-Patch-ExcludePackage | PERLANCAR | Exclude some packages from stack trace | 2024-03-15T00:06:01 |
Comparer-from_sortkey | PERLANCAR | Compare keys generated by a SortKey:: module | 2024-03-16T00:05:16 |
Compression-Util | TRIZEN | Implementation of various techniques used in data compression. | 2024-03-21T01:02:57 |
Data-Dump-HTML-Collapsible | PERLANCAR | Dump Perl data structures as HTML document with collapsible sections | 2024-03-08T08:22:33 |
Data-Dump-HTML-PopUp | PERLANCAR | Dump Perl data structures as HTML document with nested pop ups | 2024-03-18T13:24:01 |
Data-Dump-IfSmall | PERLANCAR | Like Data::Dump but reference with dump larger than a certain size will be dumped as something like 'LARGE:ARRAY(0x5636145ea5e8)' | 2024-03-18T00:06:06 |
Data-Dump-SkipObjects | PERLANCAR | Like Data::Dump but objects of some patterns are dumped tersely | 2024-03-19T00:05:05 |
Data-Navigation-Item | SKIM | Data object for navigation item. | 2024-03-04T11:53:10 |
Date-Holidays-Adapter-USA | GENE | Adapter for USA holidays | 2024-03-19T20:38:52 |
Date-Holidays-USA | GENE | Provides United States of America holidays | 2024-03-19T20:09:45 |
Devel-Confess-Patch-UseDataDumpIfSmall | PERLANCAR | Use Data::Dump::IfSmall format refs | 2024-03-20T00:05:59 |
Devel-Confess-Patch-UseDataDumpSkipObjects | PERLANCAR | Use Data::Dump::SkipObjects to stringify some objects | 2024-03-21T00:06:11 |
Dist-Zilla-Plugin-Sah-SchemaBundle | PERLANCAR | Plugin to use when building Sah-SchemaBundle-* distribution | 2024-03-22T00:05:48 |
Dist-Zilla-Role-GetDistFileURL | PERLANCAR | Get URL to a file inside a Perl distribution | 2024-03-23T00:05:56 |
GCC-Builtins | BLIAKO | access GCC compiler builtin functions via XS | 2024-03-19T13:31:21 |
ImgurAPI | DILLANBH | Imgur API client | 2024-03-20T03:11:21 |
ImgurAPI-Client | DILLANBH | 2024-03-20T03:31:39 | |
Intellexer-API | HAX | Perl API client for the Intellexer, a webservice that, "enables developers to embed Intellexer semantics products using XML or JSON." | 2024-03-04T02:34:33 |
LaTeX-Easy-Templates | BLIAKO | Easily format content into PDF/PS/DVI with LaTeX templates. | 2024-03-15T21:43:58 |
Markdown-Perl | MATHIAS | Very configurable Markdown processor written in pure Perl, supporting the CommonMark spec and many extensions | 2024-03-31T21:17:51 |
Module-Features-PluginSystem | PERLANCAR | Features of modules that generate text tables | 2024-03-25T00:05:33 |
Module-Pluggable-_ModuleFeatures | PERLANCAR | Features declaration for Module::Pluggable | 2024-03-26T00:05:20 |
Net-MailChimp | ARTHAS | Perl library with MINIMAL interface to use MailChimp API. | 2024-03-14T13:52:35 |
Net-OpenVPN-Manager | ATOY | Start OpenVPN Manager and return PSGI handler | 2024-03-08T18:07:11 |
Net-PaccoFacile | ARTHAS | Perl library with MINIMAL interface to use PaccoFacile API. | 2024-03-01T16:16:12 |
OpenAPI-PerlGenerator | CORION | create Perl client SDKs from OpenAPI specs | 2024-03-24T11:02:37 |
Plack-App-CPAN-Changes | SKIM | Plack application for CPAN::Changes object. | 2024-03-14T18:23:48 |
Plack-Middleware-Static-Precompressed | ARISTOTLE | serve a tree of static pre-compressed files | 2024-03-14T11:30:12 |
Plugin-System-_ModuleFeatures | PERLANCAR | Features declaration for Plugin::System | 2024-03-27T00:05:42 |
Qhull | DJERIUS | a really awesome library | 2024-03-05T20:37:59 |
Regexp-IntInequality | HAUKEX | generate regular expressions to match integers greater than / less than / etc. a value | 2024-03-08T17:59:24 |
Sah-SchemaBundle | PERLANCAR | Convention for Sah-SchemaBundle-* distribution | 2024-03-28T00:05:49 |
Sah-SchemaBundle-Array | PERLANCAR | Sah schemas related to array type | 2024-03-29T00:05:36 |
Sah-SchemaBundle-ArrayData | PERLANCAR | Sah schemas related to ArrayData | 2024-03-30T00:05:33 |
Sah-SchemaBundle-Binary | PERLANCAR | Sah schemas related to binary data | 2024-03-17T00:05:16 |
Sah-SchemaBundle-Bool | PERLANCAR | Sah schemas related to bool data type | 2024-03-24T00:05:52 |
Sah-SchemaBundle-BorderStyle | PERLANCAR | Sah schemas related to BorderStyle | 2024-03-31T00:05:05 |
Tags-HTML-CPAN-Changes | SKIM | Tags helper for CPAN::Changes object. | 2024-03-14T09:55:49 |
Template-Plugin-Package | PETDANCE | allow calling of class methods on arbitrary classes that do not accept the class name as their first argument. | 2024-03-12T04:32:11 |
Tk-FileBrowser | HANJE | Multi column file system explorer | 2024-03-29T21:22:08 |
WWW-Gemini | ANTONOV | 2024-03-11T02:51:49 | |
lib-root | HERNAN | find perl root and push lib modules path to @INC | 2024-03-30T17:27:02 |
Number of new CPAN distributions this period: 78
Number of authors releasing new CPAN distributions this period: 25
Authors by number of new CPAN distributions this period:
No | Author | Distributions |
---|---|---|
1 | PERLANCAR | 33 |
2 | CHRISARG | 9 |
3 | SKIM | 4 |
4 | TULAMILI | 4 |
5 | DJERIUS | 3 |
6 | BOD | 2 |
7 | ARTHAS | 2 |
8 | GENE | 2 |
9 | BLIAKO | 2 |
10 | DILLANBH | 2 |
11 | HERNAN | 1 |
12 | UTASHIRO | 1 |
13 | DAVECROSS | 1 |
14 | TRIZEN | 1 |
15 | ARISTOTLE | 1 |
16 | HAX | 1 |
17 | HANJE | 1 |
18 | JKEENAN | 1 |
19 | HAUKEX | 1 |
20 | MATHIAS | 1 |
21 | CORION | 1 |
22 | ATOY | 1 |
23 | PETDANCE | 1 |
24 | ANTONOV | 1 |
25 | SIDNEY | 1 |
Published by Blag aka Alvaro Tejada Galindo on Thursday 11 April 2024 17:59
Let’s continue our exploration of programming languages, with another well know language although not always loved, Perl.
Published by Ted James on Thursday 11 April 2024 16:43
Published by alh on Tuesday 09 April 2024 13:03
Dave writes:
This is my monthly report on work done during March 2024 covered by my TPF perl core maintenance grant.
Less hours than normal last month due to a combination of jury service and the consequences of spending lots of time with my fellow jurors.
I spent my time mainly on general small tasks to help get blead into shape for the 5.40 release, such as analysing and reducing smoke failures, and fixing bugs.
SUMMARY: * 1:39 "Variable is not available" warning on nested evals * 3:44 #21784 BBC: Blead breaks MLEHMANN/Coro-6.57.tar.gz * 4:15 make stack reference counted - XS * 2:22 process p5p mailbox * 1:38 reduce smoke failures * 1:38 review Coverity reports * 7:42 rework XS documentation
TOTAL: * 22:58 (HH::MM)
I gave my first public talk sometime between the 22nd and 24th September 2000. It was at the first YAPC::Europe which was held in London between those dates. I can’t be any more precise because the schedule is no longer online and memory fades.
I can, however, tell you that the talk was a disaster. I originally wasn’t planning to give a talk at all, but my first book was about to be published and the publishers thought that giving a talk about it to a room full of Perl programmers would be great marketing. I guess that makes sense. But what they didn’t take into account was the fact that I knew nothing about how to give an interesting talk. So I threw together a few bullet points taken from the contents of the book and wrote a simple Perl script to turn those bullet points into HTML slides (it was 2000 – that’s what everyone did). I gave absolutely no thought to what the audience might want to know or how I could tell a story to guide them through. It was a really dull talk. I’m sorry if you were in the audience. Oh, and add the fact that I was speaking after the natural raconteur, Charlie Stross and you can probably see why I’m eternally grateful that the videos we took of the conference never saw the light of day. I left the stage knowing for sure that public speaking was not for me and vowed that I would never give another talk.
But…
We were experimenting with a session of lightning talks at the conference and I had already volunteered to give a talk about my silly module Symbol::Approx::Sub. I didn’t feel that I could back out and, anyway, it was only five minutes. How bad could it be?
As it turns out, with Symbol::Approx::Sub I had stumbled on something that was simultaneously both funny and useful (well, the techniques are useful – obviously the module itself isn’t). And I accidentally managed to tell the story of the module engagingly and entertainingly. People laughed. And they clapped enthusiastically at the end. I immediately changed my mind about never speaking in public again. This was amazing. This was as close as I was ever going to get to playing on stage at the Hammersmith Odeon. This was addictive.
But something had to change. I had to get better at it. I had to work out how to give entertaining and useful talks that were longer than five minutes long. So I studied the subject of public speaking. The Perl community already had two great public speakers in Mark Dominus and Damian Conway and I took every opportunity to watch them speak and work out what they were doing. It helped that they both ran courses on how to be a better public speaker. I also read books on the topic and when TED talks started coming online I watched the most popular ones obsessively to work out what people were doing to give such engaging talks (it turns out the answer really boils down to – taking out most of the content!)
And I practiced. I don’t think there was a conference I went to between 2000 and 2020 where I didn’t give a talk. I’d never turn down an opportunity to speak at a Perl Mongers meeting. And. while I’m certainly not Damian Conway, I like to think I got better at it. I’d get pretty good scores whenever there was a feedback form.
All of which means that I’ve given dozens of talks over the last twenty-plus years. From lightning talks to all-day (actually, a couple of two-day) training sessions. I’ve tried to be organised about keeping copies of the slides from all of the talks I’ve given, but I fear a few decks have slipped through the cracks over the years. And, of course, there are plenty of videos of me giving various talks over that time.
I’ve been thinking for a while that it would be good to gather them all together on one site. And, a couple of weeks ago. I started prodding at the project. Today, it reached the stage where it’s (just barely) useable. It’s at talks.davecross.co.uk. Currently, it’s just a list of talk titles and it only covers the last five years or so (and for a lot of that time, there were no conferences or meetings to speak at). But having something out there will hopefully encourage me to expand it in two dimensions:
The second point is going to be fun. There will be some serious data archaeology going on. I think I can dig out details of all the YAPCs and LPWs I’ve spoken at – but can I really find details of every London Perl Mongers technical meeting? And there are some really obscure things in there – I’m pretty sure I spoke at a Belgian Perl Workshop once. And what was that Italian conference held in Ferrara just before the Mediterranean Perl Whirl? There’s a lot of digging around in the obscure corners of the web (and my hard disk!) in my near future.
Wish me luck.
The post Collecting talks first appeared on Perl Hacks.
Published by Robert McMenemy on Thursday 04 April 2024 05:34