perlquestion
punkish
I read [id://801215] with interest, but consider the following
<p>
<code>
sub foo {
my @arra = ('a' .. 'z');
my @arrb;
for ( 0 .. ( $#arra - 1) ) {
bar($_);
}
bar($#arra);
sub bar {
my ($i) = @_;
push @arrb, $arra[$i];
}
return \@arrb;
}
</code>
<p>
The above works, but what all sentiments and principles am I violating here? (besides, of course, [http://www.answers.becomegorgeous.com/hair/has_anyone_seen_or_had_blonde_highlights_with_a_little_purple_that_blends_added_to_their_brown_hair-8117.html|Blond highlights with a hint of purple are just "so 2007]
<p>
Essentially, bar() will never be called from outside foo(), and makes sense only within the context of foo(). In case I shouldn't be doing the above, then how should I rewrite it?
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-231169">
--
<br><br><i>
when small people start casting long shadows, it is time to go to bed</i>
</div></div>