Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • by oylenshpeegul (9338) on 2009.10.18 12:57 (#70913)
    Calling my comment on SO "scope bashing" is unfair. I'm all in favor of scoping everything as tightly as possible. Indeed, I agree with everything in chromatic's post. But I still think the practice of wrapping a Perl script in a main subroutine is not "best" or even good. I maintain it's an antipattern that indicates the author is a C programmer, not a Perl programmer. In chromatic's example, $sth has tighter scope than the other variables, but in the first case, it's declared along with the rest. Wrapping the whole thing in a subroutine doesn't change that. You still have to do everything he talked about.
    • You're right that I haven't chosen my words properly. I should have said scope discussion.

      Please accept my apologies.