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

Re: Easy hash question (uninitialized value)

by 1nickt (Monsignor)
on May 16, 2018 at 11:53 UTC ( #1214644=note: print w/replies, xml ) Need Help??


in reply to Easy hash question (uninitialized value)

The solution, as others have said, is to use chomp to strip the newline characters from the input. But how could you have known that was the problem?

When it doesn't make sense to you, add more debugging!

my $number = <STDIN>; say ">$number<";

Hope this helps!


The way forward always starts with a minimal test.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2018-11-19 07:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My code is most likely broken because:
















    Results (208 votes). Check out past polls.

    Notices?