summaryrefslogtreecommitdiff
path: root/gemfeed
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2025-11-01 16:25:59 +0200
committerPaul Buetow <paul@buetow.org>2025-11-01 16:25:59 +0200
commit4b264eda17e0712e41d155c5259b58cb4f1a51b9 (patch)
tree5f8f87424afc9fe649b890a212fb8fe46798d385 /gemfeed
parent9d76f02ace424b7200d3a692f80b85df8c2ea048 (diff)
Update content for md
Diffstat (limited to 'gemfeed')
-rw-r--r--gemfeed/2025-11-02-perl-new-features-and-foostats.md9
1 files changed, 2 insertions, 7 deletions
diff --git a/gemfeed/2025-11-02-perl-new-features-and-foostats.md b/gemfeed/2025-11-02-perl-new-features-and-foostats.md
index 8f4dca74..3e1a8e0d 100644
--- a/gemfeed/2025-11-02-perl-new-features-and-foostats.md
+++ b/gemfeed/2025-11-02-perl-new-features-and-foostats.md
@@ -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 };