Allegakoen, Justin Devanandan wrote:

So question is, if this string was packed with pack in Perl would it be interpreted by the hardware that it's pumped into in the same way
that the resultant compiled Pascal output would?

If it helps any here's a sample Pascal line that gets compiled:-

write ('0000@@00000000@FF1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF');

The resultant compiled output is a binary file which
doesnt display correctly when pasted in this e-mail.

But when opened with gvim you can see control characters all the way
through i.e.
0000^@^@00000000^@^F^F1^F^F^F^F^F^F^F^F^F^F^F^F^F^F^F^F^F^F^F^F^F^F^F^F^F^F^
F^F^F^F^F^F^@^@^A/

Could I write pack("a*",
'0000@@00000000@FF1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF');
and get it to behave as I expect?
I think that the ascii value of ^@ (control @) is 0 and the ascii value of control F is 6, expressed as the ascii value of "F" 70 - 64 = 6. If this is the conversion that you're looking for, then something like

my $j = '0000@@00000000@FF1FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF';
$j =~ tr/@A-Z/\000-\026/;
print $j;

might work.



_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs


Reply via email to