Skip to content

Instantly share code, notes, and snippets.

@tadzik
Created April 26, 2012 17:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tadzik/2501044 to your computer and use it in GitHub Desktop.
Save tadzik/2501044 to your computer and use it in GitHub Desktop.
100 my $tmpl-project = '
101 <tr><td style="border-bottom:1px dotted #98CAEB">%s</td>
102 <td><div class="%s">%s</div></td>
103 <td><div class="%s">%s</div></td>
104 <td><div class="%s">%s</div></td>
105 <td>
106 <a href="%s">Github</a>
107 </td>
108 </tr>
109 ';
119 multi gen-result(Pies::Project $p, True) {
120 my $name = $p.name;
121 my $url = url($p);
122 say sprintf $tmpl-project, $name, good(), good(), good(), $url;
123 sprintf $tmpl-project, $p.name, good(), good(), good(), url($p)
124 }
Results in:
# first call
<tr><td style="border-bottom:1px dotted #98CAEB">Acme::Meow</td>
<td><div class="implemented">+</div></td>
<td><div class="implemented">+</div></td>
<td><div class="implemented">+</div></td>
<td>
<a href="http://github.com/tadzik/perl6-Acme-Meow">Github</a>
</td>
</tr>
# second call
';' is not a valid sprintf format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment