programming-examples/perl/SystemFunction/Using vec.pl

10 lines
336 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#!/usr/local/bin/perl
$vector = pack ("B*", "11110011");
$val1 = vec ($vector, 0, 4);
$val2 = vec ($vector, 1, 4);
print ("high-to-low order values: $val1 and $val2\n");
$vector = pack ("b*", "11110011");
$val1 = vec ($vector, 0, 4);
$val2 = vec ($vector, 1, 4);
print ("low-to-high order values: $val1 and $val2\n");