diff options
| author | Paul Buetow <paul@buetow.org> | 2025-11-01 16:26:00 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2025-11-01 16:26:00 +0200 |
| commit | d784473cef147a0d64e3c4835b26ac4f0f08def9 (patch) | |
| tree | 9d3bade98be2f786edeba04a5a92f4a55d660196 /gemfeed | |
| parent | 90eeff83f8acf56a356e5a78f8603803bedc0e59 (diff) | |
Update content for gemtext
Diffstat (limited to 'gemfeed')
| -rw-r--r-- | gemfeed/2025-11-02-perl-new-features-and-foostats.gmi | 9 | ||||
| -rw-r--r-- | gemfeed/2025-11-02-perl-new-features-and-foostats.gmi.tpl | 9 | ||||
| -rw-r--r-- | gemfeed/atom.xml | 11 |
3 files changed, 7 insertions, 22 deletions
diff --git a/gemfeed/2025-11-02-perl-new-features-and-foostats.gmi b/gemfeed/2025-11-02-perl-new-features-and-foostats.gmi index 97f40137..52b02504 100644 --- a/gemfeed/2025-11-02-perl-new-features-and-foostats.gmi +++ b/gemfeed/2025-11-02-perl-new-features-and-foostats.gmi @@ -244,7 +244,6 @@ Loops over like `$stats->{page_ips}->{urls}->%*` or `$merge{$key}->{$_}->%*` sho use v5.38; print "Hello, world!\n"; # old way - say "Hello, world!"; # new way ``` @@ -257,13 +256,10 @@ This is an example of a lexical sub named `trim`, which is only visible within t ```perl use v5.38; -sub process_lines { - my @lines = @_; - +sub process_lines (@lines) { my sub trim ($str) { $str =~ s/^\s+|\s+$//gr; } - return [ map { trim($_) } @lines ]; } @@ -365,8 +361,7 @@ The `defer` block (`use feature 'defer"`) schedules a piece of code to run when ```perl use feature qw(defer); -sub parse_log_file { - my ($path) = @_; +sub parse_log_file ($path) { open my $fh, '<', $path or die "Cannot open $path: $!"; defer { close $fh }; diff --git a/gemfeed/2025-11-02-perl-new-features-and-foostats.gmi.tpl b/gemfeed/2025-11-02-perl-new-features-and-foostats.gmi.tpl index 17afe444..bec86a97 100644 --- a/gemfeed/2025-11-02-perl-new-features-and-foostats.gmi.tpl +++ b/gemfeed/2025-11-02-perl-new-features-and-foostats.gmi.tpl @@ -219,7 +219,6 @@ Loops over like `$stats->{page_ips}->{urls}->%*` or `$merge{$key}->{$_}->%*` sho use v5.38; print "Hello, world!\n"; # old way - say "Hello, world!"; # new way ``` @@ -232,13 +231,10 @@ This is an example of a lexical sub named `trim`, which is only visible within t ```perl use v5.38; -sub process_lines { - my @lines = @_; - +sub process_lines (@lines) { my sub trim ($str) { $str =~ s/^\s+|\s+$//gr; } - return [ map { trim($_) } @lines ]; } @@ -340,8 +336,7 @@ The `defer` block (`use feature 'defer"`) schedules a piece of code to run when ```perl use feature qw(defer); -sub parse_log_file { - my ($path) = @_; +sub parse_log_file ($path) { open my $fh, '<', $path or die "Cannot open $path: $!"; defer { close $fh }; diff --git a/gemfeed/atom.xml b/gemfeed/atom.xml index 067710db..110e2bdf 100644 --- a/gemfeed/atom.xml +++ b/gemfeed/atom.xml @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom"> - <updated>2025-11-01T16:18:57+02:00</updated> + <updated>2025-11-01T16:25:00+02:00</updated> <title>foo.zone feed</title> <subtitle>To be in the .zone!</subtitle> <link href="gemini://foo.zone/gemfeed/atom.xml" rel="self" /> @@ -289,7 +289,6 @@ http://www.gnu.org/software/src-highlite --> <pre><b><u><font color="#000000">use</font></u></b> v5.<font color="#000000">38</font>; <b><u><font color="#000000">print</font></u></b> <font color="#808080">"Hello, world!\n"</font>; <i><font color="silver"># old way</font></i> - say <font color="#808080">"Hello, world!"</font>; <i><font color="silver"># new way</font></i> </pre> <br /> @@ -305,13 +304,10 @@ http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> <pre><b><u><font color="#000000">use</font></u></b> v5.<font color="#000000">38</font>; -<b><u><font color="#000000">sub</font></u></b> process_lines { - <b><u><font color="#000000">my</font></u></b> @lines = @_; - +<b><u><font color="#000000">sub</font></u></b> process_lines (@lines) { <b><u><font color="#000000">my</font></u></b> <b><u><font color="#000000">sub</font></u></b> trim ($str) { $str =~ <b><u><font color="#000000">s</font></u></b><font color="#808080">/^\s+|\s+$//</font>gr; } - <b><u><font color="#000000">return</font></u></b> [ <b><u><font color="#000000">map</font></u></b> { trim($_) } @lines ]; } @@ -431,8 +427,7 @@ http://www.lorenzobettini.it http://www.gnu.org/software/src-highlite --> <pre><b><u><font color="#000000">use</font></u></b> feature <b><u><font color="#000000">qw</font></u></b>(defer); -<b><u><font color="#000000">sub</font></u></b> parse_log_file { - <b><u><font color="#000000">my</font></u></b> ($path) = @_; +<b><u><font color="#000000">sub</font></u></b> parse_log_file ($path) { <b><u><font color="#000000">open</font></u></b> <b><u><font color="#000000">my</font></u></b> $fh, <font color="#808080">'<'</font>, $path or <b><u><font color="#000000">die</font></u></b> <font color="#808080">"Cannot open $path: $!"</font>; defer { <b><u><font color="#000000">close</font></u></b> $fh }; |
