$x and $y are in the same scope. This is good, but also bad. For one
thing, you can hang yourself real easily if you come from a C background
and expect this to keep stuff private:
$x = 10;
sub square {
($x) = @_;
$x *= $x;
}
$ans = square($x);
print "$x squared is
Tom Christiansen wrote:
Perhaps you simply know inept C programmers.
Is there any other kind? ;-)
*Kidding*!
In C, something that
isn't declared auto or static is going to be global. Seeing no
scoping declarations, the C programmer who knows C will come to the
same conclusion as the