in reply to Perl 5.36 warns for magic comparison

Update: After enabling warnings in the command line, I got the same warnings in 5.39.4. So, disregard this node.

You don't show enough for us to answer. I tried the following in two different versions of Perl (one of them older and one newer than 5.36).

I saved the following script as 2.pl:

#!/usr/bin/perl use strict; use feature qw{ say }; use warnings; my $x = 10; for my $i (1 .. 10) { $x += $i; }

I then ran

perl -d 2.pl
using both the Perl versions.

5.26.1:

DB<1> @lines=@{"_<2.pl"} ; for my $i (0 .. $#lines) { CORE::say $lin +es[$i] == 0 } 1 1 1 1

5.39.4 (blead):

DB<1> @lines=@{"_<2.pl"} ; for my $i (0 .. $#lines) { CORE::say $lin +es[$i] == 0 } 1 1 1 1 1 1 1

The output is different, but there's no warning.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Perl 5.36 warns for magic comparison
by ikegami (Patriarch) on Oct 15, 2023 at 17:32 UTC

    You don't get any warnings because you forgot to enable warnings.