Unpack ( template, expression )
The TEMPLATE is a sequence of characters that give the order and type of values, as follows:
You may prefix a field with a %<number> to indicate that you want a <number>-bit checksum of the items instead of the items themselves. Default is a 16-bit checksum. Checksum is calculated by summing numeric values of expanded values (for string fields the sum of ord($char) is taken, for bit fields the sum of zeroes and ones). The following efficiently counts the number of set bits in a bit vector: $setbits = unpack("%32b*", $selectmask);
|file: /Techref/language/perl/unpack.htm, 0KB, , updated: 2004/11/4 20:12, local time: 2018/6/24 16:00,
|©2018 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions?|
<A HREF="http://www.piclist.com/techref/language/perl/unpack.htm"> Perl Function</A>
|Did you find what you needed?|
PICList 2018 contributors:
o List host: MIT, Site host massmind.org, Top posters @20180624 RussellMc, Van Horn, David, Sean Breheny, Isaac M. Bavaresco, Neil, David C Brown, Bob Blick, Denny Esterline, Brent Brown, James Cameron,
* Page Editors: James Newton, David Cary, and YOU!
* Roman Black of Black Robotics donates from sales of Linistep stepper controller kits.
* Ashley Roll of Digital Nemesis donates from sales of RCL-1 RS232 to TTL converters.
* Monthly Subscribers: Gregg Rew. on-going support is MOST appreciated!
* Contributors: Richard Seriani, Sr.
Welcome to www.piclist.com!