in reply to string parsing

DATA is a special filehandle (used to read data directly within the script after a __DATA__ line). Change the name of the filehandle to TOTO and it will work (and you will feel a little french).

Replies are listed 'Best First'.
(tye)Re: string parsing
by tye (Sage) on Apr 10, 2001 at 22:09 UTC

    DATA is special in that it remains open if your script has an __END__ token or your module has a __DATA__ token. It isn't so special that you can't use it like a regular file handle if you want to.

    The above code should work unaltered (as others have already reported).

            - tye (but my friends call me "Tye")

      You are right! Shame on me! I would have sworn that I saw the script show the behaviour described in the question when using DATA. I guess it's a case where I convinced myself so much that this was the problem that I failed to notice an entire screen worth of <tr>'s and <tr>'s. Pretty impressive I'd say! And I guess I'll have to check things twice from now on!

      By the way, this is the beauty of Perl Monks, if a bad advice is given it is promptly corrected (without the flames you get on usenet!). Thanks.