diagnostics: warning, deprecation, error
in Meditations
1 direct reply — Read more / Contribute
|
by Anonymous Monk
on Feb 10, 2026 at 07:55
|
|
|
390 diagnostic warnings, deprecations, errors in perl 5.002b3 Feb 03, 1996:
perl -MHTTP::Tiny -le'$|++;for(split/\n/,HTTP::Tiny->new->get("https:/
+/fastapi.metacpan.org/source/LWALL/perl5.002b3/pod/perldiag.pod")->{c
+ontent}){print${1}and$-++if/^=item\s+(\S\S.*)$/}print(($-+1)," diagno
+stic warnings, deprecations, errors in perl 5.002b3 Feb 03, 1996")'
1104 diagnostic warnings, deprecations, errors in perl v5.42.0 Compiled at Dec 17 2025:
perl -MConfig=compile_date -le'$|++;for(`perldoc -u perldiag`){print${
+1}and$-++if/^=item\s+(\S\S.*)$/}print(($-+1)," diagnostic warnings, d
+eprecations, errors in perl $^V ").compile_date()'
What is forbidden?
perl -MConfig=compile_date -le'$|++;for(`perldoc -u perldiag`){print${
+1}and$-++if/^=item\s+(\S\S.*)$/}print(($-+1)," diagnostic warnings, d
+eprecations, errors in perl $^V ").compile_date()' | grep 'forbidden'
Experimental %s on scalar is now forbidden
Initialization of state variables in list currently forbidden
Setting $/ to a reference to %s is forbidden
Setting $/ to %s reference is forbidden
Use of bare << to mean <<"" is forbidden
Use of strings with code points over 0xFF as arguments to vec is forbidden
|
The Cargo Cult Generation Has Arrived Now What?
in Meditations
3 direct replies — Read more / Contribute
|
by Anonymous Monk
on Jan 23, 2026 at 10:02
|
|
|
I asked Claude Haiku 3.5 at duck.ai a simple question and it produced
a complete working program. How the heck does an LLM translate 11
somewhat poorly chosen english words into a readable 73 line
maintainable perl program with freakin comments? It seems
impossible. What is going on? Are we done programming or are us
non vibe coders doomed to fix all the input validation and injection
and other subtle bugs that are sure to arise from hundreds of monkeys
implementing code they do not understand?
Question:
write an app that would render a Mandelbrot set in perl
Answer: I'll help you write a Perl script to render the Mandelbrot set. I'll provide a comprehensive example that creates a visual representation of the Mandelbrot set using a simple ASCII or color output method.
#!/usr/bin/perl
use strict;
use warnings;
use Term::ANSIColor;
# Mandelbrot Set Renderer
# Configuration parameters
my $width = 80; # Width of the output
my $height = 40; # Height of the output
my $max_iterations = 100; # Maximum iteration count
# Mandelbrot set calculation function
sub mandelbrot {
my ($c_real, $c_imag) = @_;
my $z_real = 0;
my $z_imag = 0;
for (my $i = 0; $i < $max_iterations; $i++) {
# Mandelbrot iteration: z = z^2 + c
my $new_real = $z_real * $z_real - $z_imag * $z_imag + $c_real
+;
my $new_imag = 2 * $z_real * $z_imag + $c_imag;
$z_real = $new_real;
$z_imag = $new_imag;
# If magnitude exceeds 2, it's not in the set
return $i if ($z_real * $z_real + $z_imag * $z_imag > 4);
}
return $max_iterations;
}
# Render the Mandelbrot set
sub render_mandelbrot {
for my $y (0 .. $height - 1) {
my $line = '';
for my $x (0 .. $width - 1) {
# Map pixel coordinates to complex plane
my $real = ($x / $width) * 4 - 2; # X-axis from -2 to
+2
my $imag = ($y / $height) * 4 - 2; # Y-axis from -2 to
+2
my $iterations = mandelbrot($real, $imag);
# Color/character selection based on iterations
my $char;
if ($iterations == $max_iterations) {
$char = colored('#', 'black'); # Points inside the se
+t
} else {
# Gradient coloring based on iteration count
my $color = _get_color($iterations);
$char = colored('*', $color);
}
$line .= $char;
}
print "$line\n";
}
}
# Color selection function
sub _get_color {
my ($iterations) = @_;
my @colors = (
'red', 'green', 'yellow', 'blue',
'magenta', 'cyan', 'bright_red', 'bright_green'
);
return $colors[$iterations % scalar(@colors)];
}
# Main execution
print "Mandelbrot Set Visualization\n";
render_mandelbrot();
It also summarized what it did in english:
|
LeetCode's ignorance of Perl
in Meditations
4 direct replies — Read more / Contribute
|
by Anonymous Monk
on Jan 11, 2026 at 23:07
|
|
|
Ignoring a language as venerable as Perl on a site like LeetCode seems really strange. Thoughts?
Supported:
Bash
C
C++
C#
Dart
ECMAScript
Elixir
Erlang
Go
Java
JavaScript
Kotlin
PHP
Python
Python3
Racket
Ruby
Rust
Scala
Swift
TypeScript
|
Goodbye Zefram
in Meditations
2 direct replies — Read more / Contribute
|
by Anonymous Monk
on Mar 12, 2025 at 04:58
|
|
|
In perl.perl5.porters, Philippe Bruhat wrote:
I'm very sorry to be the bearer of sad news, which I just learned
from a co-worker who was in regularl contact with Zefram.
He forwarded me this:
We are sad to announce that Zefram (Andrew Main) died yesterday
(2025-03-10) after being hit by a train. Further details are not yet
available. Everyone close to him is very shocked by this and contact
details and further arrangements will be announced in future. He was a long-time and prolific contributor to Perl core and CPAN,
and he will be missed.
I will forward further details (memorial or place to send condolences)
as I receive them.
Christian Walde then followed up with:
Thanks for bearing the news BooK, even if it is sad news.
As an additional bit of info, his personal website's section on this
matter is relevant: https://www.fysh.org/~zefram/personal/death
|
Imager support for PNG, JPEG and GIF on macOS Sonoma
in Meditations
1 direct reply — Read more / Contribute
|
by Anonymous Monk
on Apr 20, 2024 at 22:51
|
|
|
Installing our beloved Imager on macOS Sonoma with support for PNG, JPEG and GIF involves some pain. Here are the results of my struggle so others won't have to. Do this after installing Imager (requires Homebrew):
brew install pkg-config
brew install libpng
pkg-config --cflags libpng
cpan Imager::File::PNG
brew install jpeg
pkg-config --cflags libjpeg
cpan Imager::File::JPEG
brew install giflib
cpan Imager::File::GIF
GIF: Test code failed: Can't link/include 'gif_lib.h', 'stdio.h', 'errno.h', 'string.h', 'gif'...
! Configure failed for Imager-File-GIF-0.98. See /Users/you/.cpanm/work/1713652269.80239/build.log for details.
cd /Users/you/.cpanm/work/1713652269.80239/Imager-File-GIF-0.98
perl Makefile.PL -v --incpath=/opt/homebrew/include --libpath=/opt/homebrew/var/homebrew/linked/giflib/lib
make
make test
make install
For some reason the following didn't work with the cpan client:
o conf makepl_arg "LIBS=-L/opt/homebrew/var/homebrew/linked/giflib/lib INC=-I/opt/homebrew/include"
PS - pkg-config can't find giflib so the paths were found like this:
sudo /usr/libexec/locate.updatedb
locate giflib
/opt/homebrew/var/homebrew/linked/giflib
locate gif_lib.h
/opt/homebrew/Cellar/giflib/5.2.1/include/gif_lib.h
/opt/homebrew/include/gif_lib.h
|
CPAN autobundle fail
in Meditations
2 direct replies — Read more / Contribute
|
by Anonymous Monk
on Apr 10, 2024 at 13:50
|
|
|
I was trying to autobundle an old perl setup but
cpan was just sitting there failing to contact mirrors (cpanm user so that mirror list was probably ancient). This inspired me to visit https://www.cpan.org/SITES.html
where it says www.cpan.org don't do mirrors anymore. Created the autobundle like so:
cpan -M https://www.cpan.org -a
|
Fast sliding submatrix sums with PDL (inspired by PWC 248 task 2)
in Meditations
5 direct replies — Read more / Contribute
|
by Anonymous Monk
on Dec 25, 2023 at 19:51
|
|
|
Task 2: Submatrix Sum
Submitted by: Jorg Sommrey
You are given a NxM matrix A of integers.
Write a script to construct a (N-1)x(M-1) matrix B
having elements that are the sum over the 2x2 submatrices of A,
b[i,k] = a[i,k] + a[i,k+1] + a[i+1,k] + a[i+1,k+1]
Example 1
Input: $a = [
[1, 2, 3, 4],
[5, 6, 7, 8],
[9, 10, 11, 12]
]
Output: $b = [
[14, 18, 22],
[30, 34, 38]
]
I tried to crank it up for entertainment -- to solve not "2x2", but arbitrary "WxH" sub-matrices of (relatively) large matrices. Sadly, it was too late into many stupid plots and tables, when I realized, that excessive summation isn't required at all. Sliding (moving) sum (or average, min/max, etc.) is a well known concept -- duh! not to un-educated me, alas. And so maybe "2x2", not "WxH", in the task, was selected not only because PWC tries to accommodate new learners. Anyway, I implemented "sliding submatrix sums" algorithm only at a later stage, in PDL, and didn't "backport" it to pure Perl (nor Pdlpp) because had already been somewhat fed-up with this 248-2, but decided to present sanitized results as a meditation.
|
PWC 244 task 2 in linear time
in Meditations
3 direct replies — Read more / Contribute
|
by Anonymous Monk
on Nov 27, 2023 at 13:22
|
|
|
Disclaimer: it's clickbait. The plot is curved, solution isn't linear, despite lack of nested loops, -- but fast.
Task 2: Group Hero
Submitted by: Mohammad S Anwar
You are given an array of integers representing the strength.
Write a script to return the sum of the powers of all possible
combinations; power is defined as the square of the largest number
in a sequence, multiplied by the smallest.
Example 1
Input: @nums = (2, 1, 4)
Output: 141
Group 1: (2) => square(max(2)) * min(2) => 4 * 2 => 8
Group 2: (1) => square(max(1)) * min(1) => 1 * 1 => 1
Group 3: (4) => square(max(4)) * min(4) => 16 * 4 => 64
Group 4: (2,1) => square(max(2,1)) * min(2,1) => 4 * 1 => 4
Group 5: (2,4) => square(max(2,4)) * min(2,4) => 16 * 2 => 32
Group 6: (1,4) => square(max(1,4)) * min(1,4) => 16 * 1 => 16
Group 7: (2,1,4) => square(max(2,1,4)) * min(2,1,4) => 16 * 1 => 16
Sum: 8 + 1 + 64 + 4 + 32 + 16 + 16 => 141
|
TPF PERL Swag
in Meditations
1 direct reply — Read more / Contribute
|
by Anonymous Monk
on Jan 09, 2023 at 02:42
|
|
|
I want some swag from The Perl Foundation but the graphics...
1. They spelled it: PERL
2. Raptors are extinct.
3. Raw onions? C'mon!
I want cool cryptic, like Perl itself:
$Perl->{5.36}
|
Front | Back
|
#!/usr/bin/perl | exit;
| |
BEGIN{} | END{}
| |
<DATA> | __DATA__
| |
use Perl; | $?
| |
$@% | ...
| |
$_ | @_
| |
Obviously: camel code
|
Perl::Dist::APPerl - Actually Portable Perl
in Perl News
4 direct replies — Read more / Contribute
|
by Anonymous Monk
on Jan 06, 2023 at 07:34
|
|
|
"Actually Portable Perl (APPerl) is a distribution of Perl that runs on several x86_64 operating systems (most Unix-like and Windows) via the same binary. It builds to a single binary with perl modules packed inside of it. Cross-platform, single binary, standalone Perl applications can be made by building custom versions of APPerl, with and without compiling Perl from scratch"
- Perl::Dist::APPerl
- computoid.com/APPerl/
|
|