note
particle
yes, there's a huge advantage. <code>do</code> is not a subroutine. it cannot take parameters. just try to <code>do</code> this!<p>
<code>
my %dispatch = (
sub_get_files => sub{ # takes one arg
local *DH;
opendir( DH, $_[0] ) or die 'Cannot open ' . $_[0];
return grep { -f $_ } readdir(DH)
},
);
my @files = $dispatch{sub_get_files}->( $dir );
</code>
do executes immediately, and would spit the results into the hash. icky.<p
<P>~Particle *<em>accelerates</em>*
<!-- a handy place to keep tags
<code>
.
</code>
<blockquote><em>.</em></blockquote>
<strong>.</strong>
<ul>
<li>.</li>
<li>.</li>
</ul>
-->
173106
173118