Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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 ( #11119552=note: print w/replies, xml ) Need Help??


in reply to Re^3: 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

So it's returning true because both $alice and $bob are undef?
  • Comment on Re^4: Learning Programming, desperately need to know what information is contained in scalar variables

Replies are listed 'Best First'.
Re^5: Learning Programming, desperately need to know what information is contained in scalar variables
by AnomalousMonk (Bishop) on Jul 20, 2020 at 17:09 UTC

    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:  <%-{-{-{-<

Re^5: Learning Programming, desperately need to know what information is contained in scalar variables
by Lotus1 (Vicar) on Jul 20, 2020 at 18:10 UTC

    My response is 'undef'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11119552]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2020-09-29 12:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (146 votes). Check out past polls.

    Notices?