Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting text string to binary

Status
Not open for further replies.

Mukima

Programmer
Joined
Aug 14, 2006
Messages
1
Location
US
Hi,

I am a beginner with perl, and have very little understandin of the language at the moment. I need to find a text string in a binary file, but am not sure how to do this. My basic idea is to read the file in binary mode, convert the text string to binary, and search for the converted binary string in the file.
To convert text string to perl, I am trying to use the pack function.
$binaryString = pack("B*", $textString);
But, I am not sure if this is the right way to go. Can someone plz give me some feedback on this, or tell me wut wuld b better or more correct approach to this problem..
Thanks in advance!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top