in reply to 1 vs "1"

UPDATE: Oct, 11 2001
Ok, now i know why davorg was getting on to me about my original post - first off, i misunderstood the question, secondly, my regex was quite pitiful.

davorg was on to me because ...

  1. he knew that i own his book
  2. his book has a better regex

Replies are listed 'Best First'.
Re: (jeffa) Re: 1 vs "1"
by davorg (Chancellor) on Sep 12, 2001 at 19:11 UTC

    Unless I misunderstood the original question, this doesn't answer it. I read it to mean that if you had two scalars like this:

    my $number = 1; my $string = "1";

    how would you tell which is a string and which is a number. I don't think your solution addresses this.

    Oh, and your regex to check for floating point numbers could use some work too :)


    Perl Training in the UK <>