Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: The joys of bad code

by revdiablo (Prior)
on Oct 26, 2004 at 16:47 UTC ( #402702=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      sub bin {
          my $num = shift;
    ...
    
          return $bin;
      }
    
  2. or download this
      sub bin {
          substr unpack("B*", pack "i", $_[0]), 0, 8;
      }
    
  3. or download this
      sub bin {
          sprintf "%08b", $_[0];
      }
    
  4. or download this
      if(-e "$bmfile") {
          &addlink("$bmfile","$url","$desc");
      } else {
          &newbmfile("$bmfile","$url","$desc");
      }
    
  5. or download this
      LINE: foreach $line (@bmfile) {
          chomp($line);
    ...
          } else { next LINE; }
          if($link) { $links[$#links+1] = "$desc,$link"; }
      }
    
  6. or download this
      while(defined($line = <IN>)) {
          chomp($line);
    ...
              $ctr++;
          }
      }
    
  7. or download this
      open(IN, "<$accesslog_file") 
        or die "Cannot open $accesslog_file for input: $!\n";
    ...
          }
      }
      close(IN);
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://402702]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (12)
As of 2015-07-06 15:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (77 votes), past polls