hex represenation from string in perl
- From: "archilleswaterland@xxxxxxxxxxx" <archilleswaterland@xxxxxxxxxxx>
- Date: 5 Sep 2005 14:12:08 -0700
Hi,
I have a file with the following contents
1111
1100
1001
..
..
..
I read it into an array and want to represent it as hex.
so I want the output to read
f
c
9
..
..
..
Any suggestions ?
thanks,
Newbie
-------------------------
#!usr/bin/perl
$file_name= <~/values>;
open(file_handler,$file_name);
@arr_file_content= <file_handler>;
close (file_handler);
print ("@arr_file_content");
foreach $v (@arr_file_content){
chomp;
printf("%0x\n",int($v));
}
this doesn't work,
-----------------
.
- Follow-Ups:
- Re: hex represenation from string in perl
- From: John W. Krahn
- Re: hex represenation from string in perl
- From: A. Sinan Unur
- Re: hex represenation from string in perl
- Prev by Date: Re: maintainable code?
- Next by Date: Re: hex represenation from string in perl
- Previous by thread: FAQ 5.17 How can I open a file with a leading ">" or trailing blanks?
- Next by thread: Re: hex represenation from string in perl
- Index(es):
Relevant Pages
|