I think that
merlyn's CGI.pm solution looks more consise,
but here is another version anyway ... it uses
HTML::Template:
use CGI qw(header);
use HTML::Template;
my @array = (
"Synergy", "Strategic fit", "Core competencies", "Out of the box",
"Bottom line", "Revisit", "Take that off line", "24/7",
"Out of the loop", "Benchmark", "Value-added", "Proactive",
"Win-win", "Think out side the box", "Fast track", "Result driven",
"Empower (ment)", "Knowledge base", "At the end of the day",
"Touch base", "Mindset", "Client focus (ed)", "Ballpark",
"Game plan", "Leverage", "Top down", "User friendly", "On time",
"Within budget", "Forecast", "Optimistic",
);
my $html = do {local $/;<DATA>};
my $tmpl = HTML::Template->new(scalarref => \$html);
# double map borrowed from merlyn and slightly altered
$tmpl->param(
row => [
map {{
col => [
map {
{ data => splice(@array, rand scalar @array, 1) }
} 1..5
]
}} 1..5
]
);
print header, $tmpl->output;
__DATA__
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Bullshit Bingo</title>
</head>
<body>
<table cellpadding="10" border="2" cellspacing="0">
<tmpl_loop row>
<tr>
<tmpl_loop col>
<td align="center"><tmpl_var data></td>
</tmpl_loop>
</tr>
</tmpl_loop>
</table>
</body>
</html>
jeffa
L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.