Outputs.pm

wiley_dist/src/convert/perl/MudConvert/Outputs.pm · 1.3 KB

From the archive WileyMUD3_091205.tar.bz2

Download the archive   « Back to the archive contents

#!/usr/bin/perl -w

package MudConvert::Outputs;

use strict;
use English;
use Data::Dumper;

use base 'Exporter';
use MudConvert::WileyMUD::Output;
use MudConvert::DUMP::Output;
use MudConvert::Report::Output;

our @EXPORT_OK = qw( %output_format validate_output );

our %output_format = (
                       'DUMP' => {
                                   'Name'	=> 'DUMP',
                                   'Type'	=> 'Data Dump',
                                   'CodeRef'	=> \&MudConvert::DUMP::Output::dump_game,
                                 },
                       'Report' => {
                                   'Name'	=> 'Report',
                                   'Type'	=> 'Human Parsable',
                                   'CodeRef'	=> \&MudConvert::Report::Output::dump_game,
                                 },
                      'WileyMUD' => {
                                  'Name'	=> 'WileyMUD',
                                  'Type'	=> 'DikuMUD',
                                  'CodeRef'	=> \&MudConvert::WileyMUD::Output::dump_game,
                                },
                     );

sub validate_output {
  my $choice = shift;

  return undef if !(defined $choice);
  return grep { $_ eq $choice } (keys %output_format);
}

1;

Site Stats

Snippets: 1791
Codebases: 571