Bookmarks

Yahoo Gmail Google Facebook Delicious Twitter Reddit Stumpleupon Myspace Digg

Search queries

sqldatasource dal, wwwxxxenden, convert raid5 to raid 10 mdadm, apache force chunked, nrao wwwxxx, xxxxxdup, procmail change subject header, wwwXxx not20, Wwwxxx.doks sas, linux raid resync after reboot

Links

XODOX
Impressum

#1: Pack command

Posted on 2005-10-04 14:14:56 by Caldeira Alexandre-WAC075

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

--===============0886222326==
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C5C8DD.3B8B57C4"

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C5C8DD.3B8B57C4
Content-Type: text/plain

Hi Everybody,

I got the following problem using Active Perl:

I have a header with the string:
$header01 = "52494646F8110000514C434D666D74209600000001008D0A";

But to write in a file I need to write this string as a binary, than I use
the following command:
my( $hex ) = pack( 'H*', $header01);

Than, the problem begins here, all the time that the pack command convert
the string and find an "0A", by yourself insert a "0D" before.

Do you know how to took out the "0D" that perl insert by yourself?

Thanks,
Alexandre.

------_=_NextPart_001_01C5C8DD.3B8B57C4
Content-Type: text/html
Content-Transfer-Encoding: base64

PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBU cmFuc2l0aW9uYWwv
L0VOIj4NCjxIVE1MPjxIRUFEPg0KPE1FVEEgSFRUUC1FUVVJVj0iQ29udGVu dC1UeXBlIiBDT05U
RU5UPSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9dXMtYXNjaWkiPg0KDQoNCjxNRVRB IGNvbnRlbnQ9Ik1T
SFRNTCA2LjAwLjI4MDAuMTQ5OCIgbmFtZT1HRU5FUkFUT1I+PC9IRUFEPg0K PEJPRFk+DQo8RElW
PjxGT05UIGZhY2U9QXJpYWwgc2l6ZT0yPjxTUEFOIGNsYXNzPTA0MzIyNTQx MS0wNDEwMjAwNT5I
aSANCkV2ZXJ5Ym9keS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Y+DQo8RElWPjxGT05UIGZhY2U9QXJpYWwgc2l6ZT0y PjxTUEFOIA0KY2xh
c3M9MDQzMjI1NDExLTA0MTAyMDA1PjwvU1BBTj48L0ZPTlQ+Jm5ic3A7PC9E SVY+DQo8RElWPjxG
T05UIGZhY2U9QXJpYWwgc2l6ZT0yPjxTUEFOIA0KY2xhc3M9MDQzMjI1NDEx LTA0MTAyMDA1PlRo
YW5rcyw8L1NQQU4+PC9GT05UPjwvRElWPg0KPERJVj48Rk9OVCBmYWNlPUFy aWFsIHNpemU9Mj48
U1BBTiANCmNsYXNzPTA0MzIyNTQxMS0wNDEwMjAwNT5BbGV4YW5kcmUuPC9T UEFOPjwvRk9OVD48
L0RJVj48L0JPRFk+PC9IVE1MPg0K

------_=_NextPart_001_01C5C8DD.3B8B57C4--

--===============0886222326==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0886222326==--

Report this message

#2: Re: Pack command

Posted on 2005-10-04 15:26:22 by pDale

--===============0284381485==
Content-Type: multipart/alternative;
boundary="----=_Part_8260_26248206.1128432382857"

------=_Part_8260_26248206.1128432382857
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On 10/4/05, Caldeira Alexandre-WAC075 <Alexandre.Caldeira@motorola.com>
wrote:
>
> I have a header with the string:
> $header01 =3D "52494646F8110000514C434D666D74209600000001008D0A";
> But to write in a file I need to write this string as a binary, than I
> use the following command:
> my( $hex ) =3D pack( 'H*', $header01);
> Than, the problem begins here, all the time that the pack command conver=
t
> the string and find an "0A", by yourself insert a "0D" before.
> Do you know how to took out the "0D" that perl insert by yourself?
>

Try this:

open( FO, ">foo.out");
binmode FO;
print FO $hex;
close FO;

--
pDale Campbell

------=_Part_8260_26248206.1128432382857
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On 10/4/05, <b class=3D"gmail_sendername">Caldeira Alexandre-WAC075</b> &lt=
;<a href=3D"mailto:Alexandre.Caldeira@motorola.com">Alexandre.Caldeira@moto=
rola.com</a>&gt; wrote:<div><span class=3D"gmail_quote"></span><blockquote =
class=3D"gmail_quote" style=3D"border-left: 1px solid rgb(204, 204, 204); m=
argin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><font face=3D"Arial" size=3D"2"><span>I have a header with=20
the string: </span></font></div>
<div><font face=3D"Arial" size=3D"2"><span>$header01 =
&quot;52494646F8110000514C434D666D74209600000001008D0A&quot;;</span></font>=
</div>
<div><font face=3D"Arial" size=3D"2"><span></span></font>&nbsp;</div>
<div><font face=3D"Arial" size=3D"2"><span>But to write in a=20
file I need to write this string as a binary, than I use the following=20
command:</span></font></div>
<div><font face=3D"Arial" size=3D"2"><span>my( $hex ) =3D pack(=20
'H*', $header01);</span></font></div>
<div><font face=3D"Arial" size=3D"2"><span></span></font>&nbsp;</div>
<div><font face=3D"Arial" size=3D"2"><span>Than, the problem=20
begins here, all the time that the pack command convert the string and find=
an=20
&quot;0A&quot;, by yourself insert a &quot;0D&quot; before. </span></font><=
/div>
<div><font face=3D"Arial" size=3D"2"><span></span></font>&nbsp;</div>
<div><font face=3D"Arial" size=3D"2"><span>Do you know how to=20
took out the &quot;0D&quot; that perl insert by yourself?</span></font></di=
v>
<div><font face=3D"Arial" size=3D"2"><span></span></font></div></blockquote=
></div><br>

Try this:<br>

<br>
open( FO, &quot;&gt;foo.out&quot;);<br>

binmode FO;<br>

print FO $hex;<br>

close FO;<br>

<br>

-- <br>

pDale Campbell

------=_Part_8260_26248206.1128432382857--

--===============0284381485==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0284381485==--

Report this message

#3: RE: Pack command

Posted on 2005-11-07 18:31:10 by Caldeira Alexandre-WAC075

This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_000_01C5E3C1.0AF23188
Content-Type: multipart/alternative;
boundary="----_=_NextPart_001_01C5E3C1.0AF23188"


------_=_NextPart_001_01C5E3C1.0AF23188
Content-Type: text/plain



Hi Everybody,

I got the following problem using Active Perl:

I need to read a file that is HEXA encoded. I whant to see (when do a print
command) the HEXA values, like 8D and etc...
Do you know how to open and manage a file in hexa?

All the time that I tried Perl try to convert this to ASCII or UTF-8
encoding...

....
binmode(FILE);
$file_name= $ARGV[0];
open(FILE,$file_name)
|| die "could not open Source file\n";



while(<FILE>)
{
chomp;

#
@linha = split(/8D/); # A partir desse momento $linha[0] vale a primeira
linha
#

....

The idea is to split all the sorce file when found the 80h value.

Thanks,
Alexandre.

------_=_NextPart_001_01C5E3C1.0AF23188
Content-Type: text/html
Content-Transfer-Encoding: base64

PCFET0NUWVBFIEhUTUwgUFVCTElDICItLy9XM0MvL0RURCBIVE1MIDQuMCBU cmFuc2l0aW9uYWwv
L0VOIj4NCjxIVE1MPjxIRUFEPg0KPE1FVEEgSFRUUC1FUVVJVj0iQ29udGVu dC1UeXBlIiBDT05U
RU5UPSJ0ZXh0L2h0bWw7IGNoYXJzZXQ9dXMtYXNjaWkiPg0KDQoNCjxNRVRB IGNvbnRlbnQ9Ik1T
SFRNTCA2LjAwLjI5MDAuMjc2OSIgbmFtZT1HRU5FUkFUT1I+PC9IRUFEPg0K PEJPRFk+DQo8RElW
IGRpcj1sdHIgYWxpZ249bGVmdD48Rk9OVCBmYWNlPVRhaG9tYSBzaXplPTI+ PC9GT05UPjxCUj4m
bmJzcDs8L0RJVj4NCjxESVY+PC9ESVY+DQo8RElWPjxGT05UIGZhY2U9QXJp YWwgc2l6ZT0yPjxT
UEFOIGNsYXNzPTA0MzIyNTQxMS0wNDEwMjAwNT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ZPTlQgZmFjZT1BcmlhbCBzaXplPTI+PFNQ QU4gY2xhc3M9MDQz
MjI1NDExLTA0MTAyMDA1PjxTUEFOIA0KY2xhc3M9NjI3MjYyNDE3LTA3MTEy MDA1PlRoZSBpZGVh
IGlzIHRvIHNwbGl0IGFsbCB0aGUgc29yY2UgZmlsZSB3aGVuIGZvdW5kIHRo ZSANCjgwaCB2YWx1
ZS48L1NQQU4+PC9TUEFOPjwvRk9OVD48L0RJVj4NCjxESVY+PEZPTlQgZmFj ZT1BcmlhbCBzaXpl
PTI+PFNQQU4gDQpjbGFzcz0wNDMyMjU0MTEtMDQxMDIwMDU+PC9TUEFOPjwv Rk9OVD4mbmJzcDs8
L0RJVj4NCjxESVY+PEZPTlQgZmFjZT1BcmlhbCBzaXplPTI+PFNQQU4gDQpj bGFzcz0wNDMyMjU0
MTEtMDQxMDIwMDU+VGhhbmtzLDwvU1BBTj48L0ZPTlQ+PC9ESVY+DQo8RElW PjxGT05UIGZhY2U9
QXJpYWwgc2l6ZT0yPjxTUEFOIA0KY2xhc3M9MDQzMjI1NDExLTA0MTAyMDA1 PkFsZXhhbmRyZS48
L1NQQU4+PC9GT05UPjwvRElWPjwvQk9EWT48L0hUTUw+DQo=

------_=_NextPart_001_01C5E3C1.0AF23188--

------_=_NextPart_000_01C5E3C1.0AF23188
Content-Type: application/octet-stream;
name="ale08.rtp"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="ale08.rtp"

IyFydHBwbGF5MS4wIDEwLjEyMS42OS4xNC8yMzUyCgAAJ6YAAIukCuZWmgj8 AAAAoQCZAAAAAIBh
AAAAAACNAC3T3hCMjIyMjIyMjIwMxjzH//D3t+9/PgDmBglnG+P7tdiQfU+H 9wjGxMf///e3T28+
A2JK7IHH//n/ul87768SbmwZx//4/7bvv3knWk7/gcf/8/+7nzvP/ja4bBnH //n/ts+/7m0bhv+B
x//x/7vfP882OyhsGcf/+P+277/uWYzA/4HH//T/u38/fiLmJAChAJkAAACL gGEAAQ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QASAAAKdwAt094QjIyMjIyMjIyMDHT2al9prT6QT/fvZ4T1Ejd7bD3e E3KGKwa4+64/X2l0
rUNd6fZaIDcMjYvjwp7BpM3Un2Aine37b1ff77IKCfxWIYDB+0K+DtuRpyA3 FEuYRRv3TWHS0tqs
klZp5K37b17JfSWq28lWgC4s+mnvtfOpHF8SXAY1MrBrptNM04VeYQgAoQCZ AAAKP4BhABMAAAsE
AC3T3hCMjIyMjIyMjIwMuC0Z9w4aSQjOPKPAplh0lkZiaP+/lD6tePIG0hkM ZF9Za+hO7MaOWGPX
O2h/cVPS2PGVWDyIzEd8+mHy6lIuxUIAzsvcY3Ea+n8GIAMs1f8U8P3mrySI a5oEhmFnd/9PMH9j
roHCfRgI7LPb/rJfy78CEKzEPFej2063UdIiigEEUAChAJkAAArIgGEAFAAA C5EALdPeEIyMjIyM
jIyMjAw8iq2v33xm3KcIwqEUaeTD282JgYh2DWvsunGYt7vPxA7gsi9IsXZp mKH77pH/I7uiFABW
2HF9+BzWgShjEmridAiSGdsAtl2YOVJr3/RCD74EAWEY/i2Ca1NgcZKZGwyf S8ExWmbWMnGK/B93
Z97/vgSyZg64Z3cAF3us8f0m15zYAKEAmQAAC1CAYQAVAAAMHgAt094QjIyM jIyMjIyMDPEQC4Bh
caQtkiyROAYqLdnbcXi8LXNGVlaoeC/x/2xXOcSIFDSH4njv48nHIsYYa1KP GdaOrPe7afO+joNe
Gjo2DXbcHI+n13pqOS3T7qkVEXuOl+VJu1bxzWrLLlTffY3IwoAY6QOMy3lm 1bXp0yKYK1zVdI45
yptErhaHIzUN+qAAFAAMAAAL2oDhABYAAAweAC3T3g==

------_=_NextPart_000_01C5E3C1.0AF23188
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
------_=_NextPart_000_01C5E3C1.0AF23188--

Report this message

#4: Re: Pack command

Posted on 2005-11-07 20:33:20 by dbecoll

Caldeira Alexandre-WAC075 wrote:

>
>
> Hi Everybody,
>
> I got the following problem using Active Perl:
>
> I need to read a file that is HEXA encoded. I whant to see (when do a
> print command) the HEXA values, like 8D and etc...
> Do you know how to open and manage a file in hexa?

Do you mean HEX ASCII when you say HEXA ?

> All the time that I tried Perl try to convert this to ASCII or UTF-8
> encoding...
>
> ...
> binmode(FILE);
> $file_name= $ARGV[0];
> open(FILE,$file_name)
> || die "could not open Source file\n";

# binmode goes after the open.

binmode FILE;

# you may want to slurp the whole file if feasible and then split on
# your 80 or 8D

{ local $/ = undef; $_ = <FILE>; }
my @linha = split /8D/i;
close FILE;

> while(<FILE>)
> {
> chomp;
>
> #
> @linha = split(/8D/); # A partir desse momento $linha[0] vale a
> primeira linha
> #
> ...
>
> The idea is to split all the sorce file when found the 80h value.
_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Report this message

#5: Re: Pack command

Posted on 2005-11-07 20:43:05 by Williamawalters

--===============0621481763==
Content-Type: multipart/alternative;
boundary="-----------------------------1131392585"


-------------------------------1131392585
Content-Type: text/plain; charset="US-ASCII"
Content-Transfer-Encoding: 7bit


In a message dated 11/7/2005 1:17:44 P.M. Eastern Standard Time,
Alexandre.Caldeira@motorola.com writes:

> I got the following problem using Active Perl:
>
> I need to read a file that is HEXA encoded. I whant to see (when do a
print command)
> the HEXA values, like 8D and etc...
> Do you know how to open and manage a file in hexa?
>
> All the time that I tried Perl try to convert this to ASCII or UTF-8
encoding...
>
> ...
> binmode(FILE);

use binmode() on a file handle only AFTER the file is opened, not before.

> $file_name= $ARGV[0];
> open(FILE,$file_name)
> || die "could not open Source file\n";

binmode(FILE); # if needed -- but is it really needed here?

>
> while(<FILE>)
> {
> chomp;
> #
> @linha = split(/8D/); # A partir desse momento $linha[0] vale a
primeira linha
> #
> ...
>
> The idea is to split all the sorce file when found the 80h value.


alexandre --

i see two problems with the code above. one, with the binmode() function,
is already noted. the other is that i do not understand what the HEXA
format is. if this is the intel hex file format (e.g., records like
``:10010000214601360121470136007EFE09D2190140<cr>''), then the pack/unpack perl
functions will very nicely decode/encode these records. if HEXA is something else,
please give a link to some web reference defining it (in english, please; my
spanish is very poor) and i or someone else may be able to help.

best regards -- bill walters



-------------------------------1131392585
Content-Type: text/html; charset="US-ASCII"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; charset=3DUS-ASCII">
<META content=3D"MSHTML 6.00.2800.1400" name=3DGENERATOR></HEAD>
<BODY id=3Drole_body style=3D"FONT-SIZE: 10pt; COLOR: #000000; FONT-FAMILY:=20=
Arial"=20
bottomMargin=3D7 leftMargin=3D7 topMargin=3D7 rightMargin=3D7><FONT id=3Drol=
e_document=20
face=3DArial color=3D#000000 size=3D2>
<DIV>
<DIV>In a message dated 11/7/2005 1:17:44 P.M. Eastern Standard Time,=20
Alexandre.Caldeira@motorola.com writes:</DIV>
<DIV>&nbsp;</DIV>
<DIV>&gt; I got the following problem using Active Perl:<BR>&gt;&nbsp; <BR>&=
gt;=20
I need to read a file that is HEXA encoded. I whant to see (when do a print=20
command)<BR>&gt; the HEXA values, like 8D and etc...<BR>&gt; Do you know how=
to=20
open and manage a file in hexa?<BR>&gt;&nbsp; <BR>&gt; All the time that I t=
ried=20
Perl try to convert this to ASCII or UTF-8 encoding...<BR>&gt;&nbsp; <BR>&gt=
;=20
....<BR>&gt; binmode(FILE);</DIV>
<DIV>&nbsp;</DIV>
<DIV>use binmode() on a file handle only AFTER the file is opened, not=20
before.&nbsp;&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>&gt; $file_name=3D $ARGV[0];<BR>&gt; open(FILE,$file_name)<BR>&gt;&nbsp=
; ||=20
die "could not open Source file\n";</DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;&nbsp;&nbsp; binmode(FILE);&nbsp; # if needed -- but is it really=
=20
needed here?&nbsp;&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>&gt;&nbsp; <BR>&gt; while(&lt;FILE&gt;)<BR>&gt;&nbsp; {<BR>&gt;=20
chomp;<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n=
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;=20
#<BR>&gt;&nbsp;&nbsp; @linha =3D split(/8D/);&nbsp;&nbsp; # A partir desse m=
omento=20
$linha[0] vale a primeira=20
linha<BR>&gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;=20
#<BR>&gt; ...<BR>&gt;&nbsp; <BR>&gt; The idea is to split all the sorce file=
=20
when found the 80h value.<BR></DIV>
<DIV>&nbsp;</DIV>
<DIV>alexandre --&nbsp;&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>i see two problems with the code above.&nbsp;&nbsp; one, with the binmo=
de()=20
function, is already noted.&nbsp;&nbsp;&nbsp; the other is that i do not=20
understand what the HEXA format is.&nbsp;&nbsp; if this is the intel hex fil=
e=20
format (e.g., records like=20
``:10010000214601360121470136007EFE09D2190140&lt;cr&gt;''), then the pack/un=
pack=20
perl functions will very nicely decode/encode these records.&nbsp;&nbsp; if=20=
HEXA=20
is something else, please give a link to some web reference defining it (in=20
english, please; my spanish is very poor) and i or someone else may be able=20=
to=20
help.&nbsp;&nbsp; </DIV>
<DIV>&nbsp;</DIV>
<DIV>best regards -- bill walters&nbsp;&nbsp; </DIV>
<DIV>&nbsp;</DIV></DIV></FONT></BODY></HTML>

-------------------------------1131392585--

--===============0621481763==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
ActivePerl mailing list
ActivePerl@listserv.ActiveState.com
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
--===============0621481763==--

Report this message