Further to the AnonyMonk's post: Peter Keystrokes: Note that the invocation of the SpecifySeqLengths() function in the OPed code before the definition of the subroutine hides problems that exist in that function definition and that warnings and strict (the latter in particular) would like to bring to your attention. Consider the case of invoking the following function before its definition versus after the definition:
c:\@Work\Perl>perl -wMstrict -le
"confuse_the_issue(my $x, my %hash);
;;
sub confuse_the_issue {
print qq{x: $x};
for $x (keys %hash) {
print qq{$x $hash{$x}};
}
}
"
Use of uninitialized value $x in concatenation (.) or string at -e lin
+e 1.
x:
c:\@Work\Perl>perl -wMstrict -le
"sub confuse_the_issue {
print qq{x: $x};
for $x (keys %hash) {
print qq{$x $hash{$x}};
}
}
;;
confuse_the_issue(my $x, my %hash);
"
Global symbol "$x" requires explicit package name at -e line 1.
Global symbol "$x" requires explicit package name at -e line 1.
Global symbol "%hash" requires explicit package name at -e line 1.
Global symbol "$x" requires explicit package name at -e line 1.
Global symbol "%hash" requires explicit package name at -e line 1.
Global symbol "$x" requires explicit package name at -e line 1.
Execution of -e aborted due to compilation errors.
In the first case, Perl just gives you a light slap on the wrist, but that doesn't mean you are not already far down the road to Hell.
Give a man a fish: <%-{-{-{-<