Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 meditating upon the Monastery: (5)
As of 2014-08-30 00:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (289 votes), past polls