in reply to Basic transformations
One line of data (remember, I only used printable characters for the example):#!/usr/bin/perl -w use strict; open ( SOMEFILE, '<', "$ARGV[0]" ) or die "Can't open $ARGV[0] for reading.\n"; while (defined($_ = <SOMEFILE>)) { my @cbytes = split; my @hbytes = map(hex, @cbytes); my $hstring = pack('c*', @hbytes); } close SOMEFILE;
And the output:99 00 00 00 dd 02
Can someone tell me what is going on here? Thanks.Character in 'c' format wrapped in pack at ./test.pl line 11, <SOMEFIL +E> line 1. Character in 'c' format wrapped in pack at ./test.pl line 11, <SOMEFIL +E> line 1.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Basic transformations
by BrowserUk (Patriarch) on Nov 30, 2010 at 01:34 UTC | |
by BrowserUk (Patriarch) on Nov 30, 2010 at 01:41 UTC | |
by Anonymous Monk on Nov 30, 2010 at 01:41 UTC | |
by BrowserUk (Patriarch) on Nov 30, 2010 at 01:43 UTC |