Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by Anonymous Monk
on Jul 20, 2020 at 15:45 UTC ( #11119548=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

I see, thank you. I have another question,in this piece of code say "Catastrophic crypto fail!" if $alice eq $bob; what value is $alice eq $bob producing?
  • Comment on Re^4: Learning Programming, desperately need to know what information is contained in scalar variables
  • Download Code

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 16:43 UTC

    These things can be found out by experimentation. Experimentation is easy and highly encouraged.

    c:\@Work\Perl\monks>perl -wMstrict -le "use Data::Dump qw(dd); ;; my $value; ;; my $alice = 'alice'; my $bob = 'alice'; ;; $value = $alice eq $bob; dd 'result of evaluating a comparison that is true', $value; ;; $alice = 'alice'; $bob = 'bob'; ;; $value = $alice eq $bob; dd 'result of evaluating a comparison that is false', $value; " ("result of evaluating a comparison that is true", 1) ("result of evaluating a comparison that is false", "")
    See also Relational Operators and Equality Operators in perlop.

    Update: Didn't read far enough before posting; question already asked and answered.


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

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (4)
As of 2020-09-28 16:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (144 votes). Check out past polls.

    Notices?