in reply to Binary to decimal conversion

// read number function readNumber(){ $num = fread($this->buffer, 8); $r = ""; for($byte = 7 ; $byte >= 0 ; $byte--) { // reverse the bytes $r .= $num[$byte]; } $ret = unpack("dnum",$r); return $ret['num']; }

Replies are listed 'Best First'.
Re^2: Binary to decimal conversion
by andreas1234567 (Vicar) on Dec 11, 2007 at 09:45 UTC
    That looks at lot like the lines 153-162 from here (direct link here):
    153 // read number 154 function readNumber(){ 155 $num = fread($this->buffer, 8); 156 $r = ""; 157 for($byte = 7 ; $byte >= 0 ; $byte--) { // reverse the bytes 158 $r .= $num[$byte]; 159 } 160 $ret = unpack("dnum",$r); 161 return $ret['num']; 162 }
    And I believe that's PHP, not Perl. I'm thankful for the suggestion although still looking for the Perl equivalent of the above.
    --
    Andreas
      Translate that to perl, its easy