Loading ...
Sorry, an error occurred while loading the content.

Re: [PBML] Binary To Hex Converter?

Expand Messages
  • William Martell
    Hello, Maybe this will help. Convert Binary to Decimal like this. $decimal = 4; $binary = unpack( B32 , pack( N , $decimal)); $newdecimal = unpack( N ,
    Message 1 of 1 , Jan 7, 2004
    • 0 Attachment
      Hello, Maybe this will help.

      Convert Binary to Decimal like this.

      $decimal = 4;
      $binary = unpack("B32", pack("N", $decimal));
      $newdecimal = unpack("N", pack("B32", $binary));
      print $newdecimal;


      Then Convert Decimal to Hex like this

      print sprintf "%1x", $newdecimal;
      ----- Original Message -----
      From: Electron One
      To: perl-beginner@yahoogroups.com
      Sent: Wednesday, January 07, 2004 2:37 PM
      Subject: [PBML] Binary To Hex Converter?


      I remember being able to use a function called, $Value2 =
      DecBin2Hex($Value) but I dont think that works anymore. Can anybody
      recommend anything else?



      Unsubscribing info is here: http://help.yahoo.com/help/us/groups/groups-32.html


      Yahoo! Groups Sponsor
      ADVERTISEMENT





      ------------------------------------------------------------------------------
      Yahoo! Groups Links

      a.. To visit your group on the web, go to:
      http://groups.yahoo.com/group/perl-beginner/

      b.. To unsubscribe from this group, send an email to:
      perl-beginner-unsubscribe@yahoogroups.com

      c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.




      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.