in reply to How do I test for a NULL string?

This is trivially true. You are essentially saying that the question is nonsensical because 'NULL' is not a reserved word in the Perl language. However, it is evident that the questioner comes from a C background, in which the phrase 'NULL string' has a well-defined meaning with a suitable analogue in Perl -- that is, the string that contains no characters, or '""'.

Replies are listed 'Best First'.
Re: Re: How do I test for a NULL string?
by merlyn (Sage) on Feb 12, 2002 at 17:48 UTC
    You are essentially saying that the question is nonsensical because 'NULL' is not a reserved word in the Perl language.
    No, I'm saying more than that.
    However, it is evident that the questioner comes from a C background,
    No, it could also be an SQL background.
    in which the phrase 'NULL string' has a well-defined meaning with a suitable analogue in Perl
    No, because even NULL in C could mean NULL pointer, which is closer to undef than to an empty string.

    You have just proven my point. You assumed things that cannot be assumed. Therefore, the question is unanswerable without further information. A good question answerer understands how many different context things apply. And personally, I've seen people use NULL to mean every single one of those items in that list I give.

    -- Randal L. Schwartz, Perl hacker

      No, because even NULL in C could mean NULL pointer, which is closer to undef than to an empty string.

      Quite true, in which case the appropriate phrase would be 'NULL string pointer', or maybe 'NULL pointer to a string', but that's not how the question is stated. Now I understand the need to be sensitive to context when interpreting a question, however when I first read your post I thought you were giving a general answer suitable to a well-phrased query. If this whole debate turns on your interlocuter not knowing precise terminology, then there's really no point to this.

        If this whole debate turns on your interlocuter not knowing precise terminology, then there's really no point to this.

        I thought the whole point of his post was to point out that terms from one language dont always have the same, or for that matter _any_ meaning in another. So to introduce them to possibly equivelent , but different, terms that _do_ have a well defined meaning in the language the question was asked about can hardly be a bad thing.

        Yves / DeMerphq
        --
        When to use Prototypes?

Re: Re: How do I test for a NULL string?
by herveus (Prior) on Feb 13, 2002 at 14:18 UTC
    Howdy!

    No, it is not 'trivially' true. It is a fairly precise response to the question that solicits clarification of just what is being asked.

    The querant can then refine their question to allow a meaningful reply, assuming their apparent ignorance is actually treatable. Note that 'ignorance' is not used in its pejorative sense but in a simple descriptive sense.

    I like merlyn's response. It offers the beginning of a dialog that can lead to more than a simple answer to the poorly worded question.

    yours,
    Michael