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.
  • Folks advocate well named temp variables for clarity, similar to well named functions. Its not obvious from glancing at just a split that you're getting a list of keywords. It is obvious from "my @keywords = split ...". However, "foreach my $keyword (split ...)" works just as well.

    I have seen this concept abused.

    sub foo {
        my $thing = shift;
        my $foo = ...some simple calc...;
        return $foo;
    }

    Other times folks start out with the long hand version using temp variables. Some people find it easier to think things through that way. Then once its apparent the algorithm is simple you get a little lazy and don't bother compressing it.