cmille has asked for the wisdom of the Perl Monks concerning the following question:

For my first project in perl, I'm trying to write a text-rpm that is similar to zork and other old infocom games. I figured it would be a good way to learn perl's regex system, but anyways. I'm having to package all of the rooms in a text file, and I was wondering what would be a good way to format this file so that it would be easy for other users to create and would be easily parsed into my script.

Replies are listed 'Best First'.
Re: formatting text for parsing
by belg4mit (Prior) on Feb 10, 2002 at 18:38 UTC
    For reference you might find Games::Rezrov/Games::Rezrov enlightening, it's (<retracted>London.pm's</retracted>) <insert>a parser for</insert> Infocom package.

    As for the storage my hunch would be CSV(either Text::CSV or DBD::CSV) or XML (XML::Simple). Though implying and not having said create by hand ;-) I'll also toss out Storable/FreezeThaw.

    --
    perl -pe "s/\b;([st])/'\1/mg"

      Firstly, I don't think that Games::Rezrov is London.pm's ;-} Not that we haven't collectively written some pretty mad stuff over the years ;-}

      Secondly the module reads yer actual Infocom Z-Code so you can play all of your favourite games from the past like Hitch-hikers guide to the galaxy on so forth.

      /J\

        Doh! I think it's somebody's though, Belfast.pm? As for reading yes, that would be why I said "for reference purposes", and said "As for storage" in the second paragraph ;-D.

        UPDATE: Helas my Bureaucracy and Hitchiker's Guide for Apple II wetn the way of curbside checkout long ago :-(. I was never able to get past the bulldozer.

        --
        perl -pe "s/\b;([st])/'\1/mg"