in reply to Re^3: two dice question
in thread two dice question

No need to learn and load a complex module for that!
my @dice = split /^--\n/m, <<'EOT'; --------- | | | # | | | --------- -- --------- | # | | | | # | --------- -- ... -- --------- | # # | | # # | | # # | --------- EOT

Replies are listed 'Best First'.
Re^5: two dice question
by Fletch (Bishop) on Jul 17, 2007 at 17:18 UTC

    Ah, but then your dice have leading spaces in front of them. :)

    my @dice = map { (my $t = $_) =~ s/^\s+(?=\S)//gm; $t } split( /^--\n/ +m, <<'EOT' ); ... EOT

      The OP had the spaces too, so I presume they're supposed to be there.

      What's the purpose of (?=\S) in your regexp?

        Stupid, unnecessary redundancy since \s+ stops at \S and i wasn't really thinking?