#!/usr/bin/perl -w # Use -d if you want only newgame ones (ie, without coloured dracs). my $db = grep /^-d$/, @ARGV; undef $/; open IN, "util/cpp_version enum.h|" or die "Can't read enum.h\n"; $_ = ; close IN; s/.*enum species_type\n\{(.*?)LAST_VALID_SPECIES.*/$1/s or die "Can't find species_type in enum.h\n"; for (/SP_([A-Z_]+)/g) { s/_/ /g; s/\b([A-Z])([A-Z]+)/\u$1\L$2/g; if ($db) { print "Draconian\n" if /Base Draconian/; next if /Draconian/; } print "$_\n"; }