in reply to Code optomization

Here are my comments:

Of course, many of these are a matter of style; those are just my first impressions.

Overall, looks like a nicely written script. Thanks for posting it!

Replies are listed 'Best First'.
Re^2: Code optomization
by sock (Monk) on Jul 08, 2004 at 20:46 UTC
    Ok, I've made some huge adjustments and code reduction. I've also applied use strict and use warnings. I'm getting one message in particular regarding the following:
    for ($3) { /transparent/ && $info{clear} == 1 && do {$use_this = 1; last;}; /anonymous/ && $info{anonymous} == 1 && do {$use_this = 1; last;}; /highanonymity/ && $info{spranonymous} == 1 && do {$use_this = 1; + last;}; }
    The actual warning:
    Use of uninitialized value in pattern match (m//) at ./ProxyHunter.pl +line 93.
    Using common sence i'm assuming that its raising an issue whenever only one of the 3 are matched. Would it be easier to use if/then statements?
    Guns don't kill people, ninjas do.
      As you say, that probably happens when $3 isn't defined. Adding something like:
      defined || last;
      at the top of that for block would probably do the trick.
        or make the "loop" for (grep defined, $3)

        We're not really tightening our belts, it just feels that way because we're getting fatter.
        I'm sorry, I don't understand. Can you explain a bit more? ----
        Guns don't kill people, ninjas do.
Re^2: Code optomization
by sock (Monk) on Jul 08, 2004 at 20:52 UTC
    Updated version for your viewing pleasure. You were right about having redundancy so I compacted the 3 diff subs into one sub that just loops through an array of the target proxylisters. It also looks much cleaner. Applied use strict and use warnings but still get an odd warning, see other post. I've also changed the arrays used, thanks for that one too. See readmore for actual code. -----
    Guns don't kill people, ninjas do.