Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

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

by karlgoethebier (Abbot)
on Jul 20, 2020 at 15:39 UTC ( #11119546=note: print w/replies, xml ) Need Help??


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

... the book doesn't want to show you what undef is... Actually it does. And probably choroba meant something different and I quoted him wrong. But I’m pretty sure that he doesn’t worry 🤪😎 Hint: Don’t just copy examples from this splendid book. Invent your own. Play and have fun. Good «trivial examples» are pure fun and hard to figure out... Best regards, Karl

«The Crux of the Biscuit is the Apostrophe»

perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

  • Comment on Re^3: Learning Programming, desperately need to know what information is contained in scalar variables
  • Download Code

Replies are listed 'Best First'.
Re^4: Learning Programming, desperately need to know what information is contained in scalar variables
by choroba (Archbishop) on Jul 21, 2020 at 07:13 UTC
    > and I quoted him wrong

    Yes, you did. I said "The example in the book" (emphasis mine, but at a later time), by which I meant that particular example. The book definitely mentions undef somewhere.

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

      It seems so. My bad. And i hope that you don’t defenestrate me when I travel to Prague. Best regards, Karl

      «The Crux of the Biscuit is the Apostrophe»

      perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help

        > don’t defenestrate me when I travel to Prague.

        Oh, first they'll treat you like a king, Král ... ;-)

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery

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
    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?

      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://11119546]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2020-09-24 11:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I don’t succeed, I …










    Results (133 votes). Check out past polls.

    Notices?