On Mon, Oct 01, 2001 at 02:36:02PM -0500, Bob Maccione wrote:

> Hmm,  since I'm using Filter::Stream I guess my next question is how to you
> tell the end of a string (for lack of a better word) in Perl?  I guess I
> could write a Filter::String and then assume that all strings end with a
> null and look for the null in the stream,  however I'm not sure if this is
> really correct (and I did search the web) and have no idea on how Perl knows
> the end of a string.

        Perl's strings are stored in a simple structure, which looks
sort of like this:

        struct {
           pointer to a buffer containing the string data
           integer, length of the string in bytes
           integer, reference counter
        };

        So it really doesn't have anything to do with the C method of
inserting a trailing character at the end of the string; a side effect
of this is that Perl's strings have no problem storing NUL characters.

_________________________________________________________________________
Dennis Taylor           "Anyone whose days are all the same and free from
[EMAIL PROTECTED]    want inhabits eternity of a sort."  - Peter Hoeg
_________________________________________________________________________
   PGP Fingerprint: E8D6 9670 4FBD EEC3 6C6B  810B 2B30 E529 51BD 7B90

Reply via email to