Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

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

by choroba (Chancellor)
on Feb 12, 2013 at 09:15 UTC ( #1018318=note: print w/replies, xml ) Need Help??


in reply to Re^2: 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.

Except for cases where you will not. Try 9049589370.
لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
  • Comment on Re^3: how to split the string into two or three numbers based on certain value.

Replies are listed 'Best First'.
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
    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'?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1018318]
help
Chatterbox?
[haukex]: Corion: I once wrote an automated thingy for that here
[haukex]: here's the code that uses it
[Corion]: haukex: Hmm - maybe I can reuse that. I see that it uses Pod::Parser, which I think was one of the more fragile parsers. But if I'm statically (re)generating the tests instead of doing that "live" on the client/tester machines, that's a much smaller...
[Corion]: ... problem space than trying to cater to all versions of Pod::Parser(s)
[haukex]: I think you're right, I think Pod::Simple is the preferred parser now
[haukex]: But I was just using it as an author test anyway
[Corion]: haukex: Aaah - I thought you were still running these tests on every machine, but you only run these as author or Devel::Cover tests
[Corion]: haukex: Yeah, I think back then I used Test::Inline, which used a pod parser that was going through some changes and I didn't want to cater for all the various versions and thus stopped testing the Pod completely
[choroba]: I usually do this with presentations

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2017-02-27 12:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (385 votes). Check out past polls.