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

Hey Y'all,

I'm programming a roguelike in perl, and I'm running into an information deficiency. Many of the C implementations use ncurses for screen output, and I know we have some lovely perl mods for just that, but is there something better under perl??

Currently I just store the information in a hash of hashes, and then use a format. But between the various layers of the dungeon, that can get hairy. (IE: Level is a 256x256 grid, with hashes for the following: Floor Plan, Treasure map, Monster map, trap map, char map. That's alot of memory usage.)

Also, could you recommend some good sources for managing screen output in perl?? Books or webpages. I like my docs quick and dirty, because programming is more fun than reading about programming.

So in the words of the great George Plimpton, "Opine you swine..."

~Hammy

Replies are listed 'Best First'.
Re: Screen output for a Perl roguealike
by sierrathedog04 (Hermit) on Jul 10, 2001 at 21:15 UTC
    format Declare a picture format with use by the write() function. For example +: format Something = Test: @<<<<<<<< @||||| @>>>>> $str, $%, '$' . int($num) . $str = "widget"; $num = $cost/$quantity; $~ = 'Something'; write; See the perlform manpage for many details and examples. Source: Perl builtin functions Copyright: Larry Wall, et al.
    is the standard way to manage screen output in Perl. I get the impression that a lot of Perl output these days is in HTML and so format is less widely used than before. But the format command can appear even in HTML output pages.
Re: Screen output for a Perl roguealike
by mikeB (Friar) on Jul 11, 2001 at 00:45 UTC