- or download this
struct SupplyRequest {
time_t request_time; // hola de solicitud
int employee_id; // empleado que la realiza
...
short quantity; // cantidad
short urgent; // ¿es urgente?
};
- or download this
Desplz. Contenido (las direcciones de memoria aumentan hacia la d
+erecha)
0 160 44 19 62| 41 82 3 0| 98 111 120 101 115 32 1
+11 102
A0 2C 13 3E| 29 52 03 00| 62 6f 78 65 73 20
+6f 66
...
p a p e r c l i p s
32 0 0 0 0 0 0 0 0| 2 0| 1 0
00 00 00 00 00 00 00 00| 02 00| 01 00
- or download this
($order_time, $monk, $itemname, $quantity, $urgent) =
unpack( "l i Z32 s2", $rec );
- or download this
pack ('a8',"hello") produce "hello\0\0\0"
pack ('Z8',"hello") produce "hello\0\0\0"
pack ('A8',"hello") produce "hello "
...
unpack('Z8',"hello\0\0\0") produce "hello"
unpack('A8',"hello ") produce "hello"
unpack('A8',"hello\0\0\0") produce "hello"
- or download this
ord(pack('b8','00100110')) produce 100 (4 + 32 + 64)
ord(pack('B8','00100110')) produce 38 (32 + 4 + 2)
- or download this
pack('h4','1234') produce 0x21,0x43
pack('H4','1234') produce 0x12,0x34
- or download this
#!/usr/bin/perl -w
use strict;
...
DumpString($rec);
$rec = pack('H4',"1234"); # debería producir 0x12,0x34
DumpString($rec);