Antons’ Corners
Anton has welcomed in the new year with two new posts:
and:
Looking forward to many more insightful and LLM friendly posts from Anton!
Events
Please mark your diaries for the German Perl/Raku Workshop, 16-18 March 2026 in Berlin
Weeklies
Weekly Challenge #355 is available for your enjoyment.
Raku Tips ‘n Tricks
This week, I am pleased to replay a snippet that was shared via IRC gist a couple of months back by Simon(SIBL) when looking for a CPAN example for the raku.org front page…
#!/usr/bin/env raku
use Spreadsheet::Read:from<Perl5>;
my $sheet = Spreadsheet::Read.new('sheet.xlsx').sheet(1);
my @team = $sheet.column(2)[1..^*];
my @lang = $sheet.column(3)[1..^*];
my @rewa = $sheet.column(4)[1..^*];
my @cols = <team lang reward>;
my %db;
for @team Z @lang Z @rewa -> @row {
my %row-data = @cols Z=> @row;
for %row-data.kv -> $col, $val {
%db{$col}{$val}.push: %row-data;
}
}
say %db<team>{23};
#OUTPUT [{lang => 46, reward => 184, team => 23}]
This example tickled my sense of the fusion of Perl and Raku and the ease of pulling in handy CPAN modules whenever required. Here we take an Excel file and make a content addressable database. Of course, the Raku Spreadsheet::XLSX or Spreadsheet::Libxlsxio modules are probably a better choice, but I bet that there are many other legacy file formats out in CPAN land where a similar trick beats writing a new Raku module.
Your contribution is welcome, please make a gist and share via the raku channel IRC or Discord.
