Created
September 21, 2009 15:58
-
-
Save EvanCarroll/190339 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use feature ':5.10'; | |
use warnings; | |
use strict; | |
my %saving_throws = ( | |
ppd => [qw(paralyzation poison death_magic)], | |
rsw => [qw(rods staves wands)], | |
pp => [qw(petrifaction polymorph)], | |
bw => [qw(breath_weapon)], | |
sp => [qw(spells)], | |
); | |
foreach (values %saving_throws) { | |
foreach ( @{$_} ) { | |
tr/_/ /; | |
} | |
}; | |
use XXX; | |
YYY \%saving_throws; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use warnings; | |
use strict; | |
use diagnostics; | |
my %saving_throws = ( | |
ppd => [qw(paralyzation poison death_magic)], | |
rsw => [qw(rods staves wands)], | |
pp => [qw(petrifaction polymorph)], | |
bw => [qw(breath_weapon)], | |
sp => [qw(spells)], | |
); | |
my @saving_throws = (@{$saving_throws{ppd}},@{$saving_throws{rsw}},@{$saving_throws{pp}},@{$saving_throws{bw}},@{$saving_throws{sp}}); | |
for (@{$saving_throws{ppd}},@{$saving_throws{rsw}},@{$saving_throws{pp}},@{$saving_throws{bw}},@{$saving_throws{sp}},@saving_throws) { | |
$_ =~ tr/_/ /; | |
ucfirst; | |
}; | |
print join("/",@{$saving_throws{ppd}})."\n"; | |
print join("/",@{$saving_throws{rsw}})."\n"; | |
print join("/",@{$saving_throws{pp}})."\n"; | |
print join("/",@{$saving_throws{bw}})."\n"; | |
print join("/",@{$saving_throws{sp}})."\n"; | |
print "\n"; | |
print join(", ",@saving_throws)."\n"; | |
print $saving_throws[rand @saving_throws]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment