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.
  • by n1vux (1492) on 2006.10.25 12:49 (#51260) Homepage Journal
    Happy Birthday!

    Yes, thank you, this is timely. I'll be turning x30 (or \060) in x0C days, but I had forgotten this was a divisible cycle. [I had noticed [perl.org] 2 years ago.]

    As an old C and PDP8/11 hack I *should* have been counting down the days ... Especially since I survied the periods of desktops with 48KB and 48MB of RAM being affordable upgrades from 32MB (64 not fitting or not affordable) and am now getting servers with 32, 48, 96, or 128GB RAM.

    (Does no one train kids to count in binary on their fingers anymore??? Easiest way to check HEX arithmetic before HEX was common on calculators!)

    --
    Bill
    # I had a sig when sigs were cool
    use Sig;
    • Rather than download a module to do arbitrary base conversion, I faked it in a one-liner, but not golfing. (If I'd used strict, it would have worked a minute quicker!)

      perl -le '@X=(0..9, 'a'..'f');
      sub d2b {my ($b,$x)=@_;
      my ($q,$r)=(int($x/$b),$x % $b);
          ($c,$q)=(int($q/$b), $q % $b);
          return ($c?$X[$c]:" ")."$X[$q]$X[$r]"; }
      $,=" ";
      while ($n = shift) {
      print $n, map {d2b($_,$n)} @B;}

      INIT {@B=(6..16); printf "dd";
         printf " %3d",$_ for @B;print "";
         @ARGV=eval

      --
      Bill
      # I had a sig when sigs were cool
      use Sig;