in reply to Perl 5.36 warns for magic comparison

I get no warning out of Perl 5.36.1 from the following script:

#!/usr/bin/env perl

use strict;
use warnings;

use v5.36;

say 'Hello, world!';

using the commands:

perl -d dbg.pl
  DB<1> @lines = @{"_<dbg.pl"}; say $_ == 0 for @lines;
1
1
1
1
1
1
1
1


  DB<2> q                                                                       

I also tried 5.36.0, with the same output and the same lack of a warning.

Maybe if you exhibited a small, self-contained example, giving the exact code and exact debugger commands to trigger the problem?

  • Comment on Re: Perl 5.36 warns for magic comparison

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.

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

      I see use warnings;

      Is this not enabling warnings?

        use warnings; has a lexical scope. You have no warnings enabled in the debugger. Use -w, or add use warnings; to the snippet you're evaluating in the debugger.