in reply to Re^2: hexdump -C
in thread hexdump -C
sub hexdump { my $s; $_[0] =~ s/\G([\0-\xff]{1,16})/ $s = $1; $s =~ y|\x20-\x7e|.|c; spri +ntf("%08X %-50s|%s|\n", $-[0], "@{[unpack q{(H2)8a0(H2)8}, $1]}", $s +);/ge; return $_[0]; }
I don't understand why I had to do this: ([\0-\xff]{1,16}) instead of (.{16}) This latter one won't capture anything, which is weird. The second thing I don't understand is why this works:
"@{[unpack q{(H2)8a0(H2)8}, $1]}"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: hexdump -C
by ikegami (Patriarch) on Oct 15, 2025 at 14:15 UTC | |
by harangzsolt33 (Deacon) on Oct 15, 2025 at 14:25 UTC | |
by ikegami (Patriarch) on Oct 15, 2025 at 14:28 UTC | |
by NERDVANA (Priest) on Oct 16, 2025 at 02:58 UTC |