Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^4: how to split the string into two or three numbers based on certain value.

by 7stud (Deacon)
on Feb 12, 2013 at 18:56 UTC ( #1018426=note: print w/replies, xml ) Need Help??


in reply to Re^3: how to split the string into two or three numbers based on certain value.
in thread how to split the string into two or three numbers based on certain value.

Ah yes. The string '0' is considered false in perl despite having a length of 1. So if $str = '0', then $str will be considered false in a boolean context where length($str) will be 1 and evaluate to true.

I wonder what the op wants to output for the string '0'? Also, I wonder what the output should be for the string '0123'?

  • Comment on Re^4: how to split the string into two or three numbers based on certain value.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1018426]
help
Chatterbox?
and the radiator hisses contentedly...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (4)
As of 2017-06-26 07:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How many monitors do you use while coding?















    Results (573 votes). Check out past polls.