[clug] C/L's are the bomb. (C/L golf time)

Andrew Janke a.janke at gmail.com
Thu May 12 22:09:28 MDT 2011


>>> … while on random musings, since it's my birthday should I finally
>>> change from "Whitesmiths style" [1] to something else?
>>
>> Yes, Python.
>
> +1.  You don't realise how deeply unpleasant all those curly braces
> and semicolons are, until you don't need to look at them anymore.

Incidentally I find my "compact" Whitesmiths style looks eerily
similar to python.

Cop this bit of perl line noise:

         # gather dependencies
         my @ds = ();
         foreach (split/\,/, $depends){
            if(m/\*/){
               my($regex) = $_;
               $regex =~ s/\*/\.\*/g;

               print STDOUT "\n\nUSING regex $regex (from: $_)\n\n";

               # search for jids with wildcard
               foreach (sort(keys(%jids))){
                  if(m/$regex/){
                     push(@ds, $jids{$_});
                     }
                  }
               }
            elsif($_ eq 'none'){
               # nothing
               }
            else{
               # add the JID if it exists
               push(@ds, $jids{$_}) if defined($jids{$_});
               }
            }
         print STDOUT "\nSze: $#ds - :" . join(':', @ds) . ":\n\n";

Almost readable!


a


More information about the linux mailing list