Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. The Lounge
  3. Why I hate Perl today

Why I hate Perl today

Scheduled Pinned Locked Moved The Lounge
javaphpperlquestion
25 Posts 13 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B BobJanova

    Did you know that it's impossible in Perl to tell the difference between '1' and 1.0? The language knows that one is a string and one is a number, but (unlike PHP which has similar flexible typing) it won't tell you which something is! This is rather annoying when trying to interface with another language (Java, in this case) where that kind of matters.

    D Offline
    D Offline
    dpminusa
    wrote on last edited by
    #21

    If you are interested, CPAN has modules you can add that help minimize this issue. Look for the scalar modules. Maybe not 100% but easy to use for most situations. Maybe this will reduce your frustration somewhat. Cheers.

    "Courtesy is the product of a mature, disciplined mind ... ridicule is lack of the same - DPM"

    1 Reply Last reply
    0
    • B BobJanova

      Did you know that it's impossible in Perl to tell the difference between '1' and 1.0? The language knows that one is a string and one is a number, but (unlike PHP which has similar flexible typing) it won't tell you which something is! This is rather annoying when trying to interface with another language (Java, in this case) where that kind of matters.

      K Offline
      K Offline
      Kirk Wood
      wrote on last edited by
      #22

      TryParse. You can't go wrong.

      1 Reply Last reply
      0
      • A Andrei Straut

        BobJanova wrote:

        The language knows that one is a string and one is a number, but it won't tell you which something is

        When programming languages start keeping secrets, you know the world is truly elephanted Here, have a cookie.

        Full-fledged Java/.NET lover, full-fledged PHP hater. Full-fledged Google/Microsoft lover, full-fledged Apple hater. Full-fledged Skype lover, full-fledged YM hater.

        K Offline
        K Offline
        Kirk Wood
        wrote on last edited by
        #23

        Actually, either of them can be used as a string or a number in Perl. If a string converts then it can easily be used as a number. You simply can't make what looks like a number not act like a number. (Nor can you ever stip something from being treated as a string.) I would encourage you to really learn a language instead of learning its syntax.

        1 Reply Last reply
        0
        • B BobJanova

          Did you know that it's impossible in Perl to tell the difference between '1' and 1.0? The language knows that one is a string and one is a number, but (unlike PHP which has similar flexible typing) it won't tell you which something is! This is rather annoying when trying to interface with another language (Java, in this case) where that kind of matters.

          T Offline
          T Offline
          thomas michaud
          wrote on last edited by
          #24

          Old issue: http://www.perlmonks.org/?node\_id=766000

          1 Reply Last reply
          0
          • D Dalek Dave

            Bent Lawyer!

            --------------------------------- I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link suspended until further notice. It can be reached at www.greystarling.co.uk/ccc.htm This is due to the Spam Cockup.

            M Offline
            M Offline
            mpmansell
            wrote on last edited by
            #25

            Type cast lawyer ?

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups