http://qs321.pair.com?node_id=11119551


in reply to Re^2: Learning Programming, desperately need to know what information is contained in scalar variables
in thread Learning Programming, desperately need to know what information is contained in scalar variables

It returns true or false. There are more details at https://perldoc.perl.org/perlop.html#Equality-Operators.

Replies are listed 'Best First'.
Re^4: Learning Programming, desperately need to know what information is contained in scalar variables
by Anonymous Monk on Jul 20, 2020 at 16:33 UTC
    So it's returning true because both $alice and $bob are undef?

      Evaluating two undef values for string equality yields a true result. undef is temporarily promoted to "" (the empty string) in string context. If warnings are enabled, warnings are emitted.

      c:\@Work\Perl\monks>perl -le "use strict; use warnings; ;; use Data::Dump qw(dd); ;; my ($value, $alice, $bob); ;; $value = $alice eq $bob; dd 'result of comparison of undefined values', $value; " Use of uninitialized value in string eq at -e line 1. Use of uninitialized value in string eq at -e line 1. ("result of comparison of undefined values", 1)


      Give a man a fish:  <%-{-{-{-<

      My response is 'undef'