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

Re: Perl length if condition not working

by Eily (Monsignor)
on Sep 25, 2018 at 10:18 UTC ( [id://1222958]=note: print w/replies, xml ) Need Help??


in reply to Perl length if condition not working

Your script does print Fail. But my guess is that rather than get '123456789' from the code you get it from STDIN (something like $param_value = <>;) which would mean there is a \n character at the end. You can solve this like that:

chomp($param_value);

If that's not your issue, you'll have to show us code where the problem is actually present. See How do I post a question effectively?.

Edit: you would be able to see the extra char with either of these:

use Data::Dumper; $Data::Dumper::Useqq = 1; ... print Dumper $param_value;
or
use Data::Dump "pp"; ... pp $param_value;
I personally prefer Data::Dump, but Data::Dumper should already be installed on your machine.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2024-04-19 19:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found