[Roma.pm] una facile

Oha oha at oha.it
Fri Apr 24 15:36:21 PDT 2009


>"d" e' la mia sub preferita:
>
>sub d{
>  my $dado = shift;
>  return int rand($dado)+1;
>}

ne approfittiamo?

sub d($) { return 1 + int rand shift; }

ha il vantaggio che puoi chiamarla senza parentesi:

my $roll = d 20 + d 8;

Oha 



More information about the Roma mailing list