scalar( @$foo )-1Use $#$foo instead, or $#{$foo}.
my $i = my $aref = ();You assign an empty list to two scalars, which isn't quite useful. Consider using just my ($i, $aref);. If you want $aref to be a reference to an empty array, use my $aref = [].
$aref = @$foo;Makes no sense. This just assigns the number of elements in @$foo to $aref. You don't need a copy by the way. I suggest a rewrite of the loop:
Or a lot easier using printf:for (@$STF1){ print OUTPUT "<li>$_->[0]</li>" . qq{<a href="$_->[1]$STF3_Tables">$_->[2]</a><br />\n} +; }
for (@STF1){ printf OUTPUT "<li>%s</li>" . qq{<a href="%s$STF3_Tables">%s</a><br />\n}, @$_; }
You have a lot of temporary variables that aren't needed.
# my @temp = foo; my $ref = [ @temp ]; my $ref = [ foo ]; # ($a, $b) = \(@a, @b); return $a, $b; return \(@a, @b);
I personally dislike things like // and do { ... } and prefer a simple if (//) { ... }.
Hope this helps...
In reply to Re: Critique / Suggestions?
by Juerd
in thread Critique / Suggestions?
by Sang
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |