#!/usr/bin/perl print "Input the dice and modifier you want to roll like this: 2d9+100. To quit, press Ctrl-C.\n"; while (1) { my $dice = <>; my @arr = split (/d/, $dice); my @arr2 = split (/\+/, $arr[1]); for my $i (1 .. $arr[0]){ print ((int(rand($arr2[0] - 1)) + 1 + $arr2[1]), "\n");}}