Solved

pack command

Posted on 2002-06-07
2
207 Views
Last Modified: 2010-03-05
How do I convert a string (alphanumeric) to binary and then back again?

e.g. $string = "a2?76574=ghgh"

I take it you use pack to convert into binary and then unpack to convert the other way, I have tried this and cant get the syntax right.  Any ideas?
0
Comment
Question by:cyrobinson
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 84

Accepted Solution

by:
ozo earned 200 total points
ID: 7063179
$string = "a2?76574=ghgh";
$binary = unpack'b*',$string;
$string = pack'b*',$binary;
0
 

Author Comment

by:cyrobinson
ID: 7063670
I was so close yet so far away.  Thanx 4 your help
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
On Microsoft Windows, if  when you click or type the name of a .pl file, you get an error "is not recognized as an internal or external command, operable program or batch file", then this means you do not have the .pl file extension associated with …
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question