home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!pipex!demon!cix.compulink.co.uk!pmoore
- Newsgroups: comp.lang.perl
- From: pmoore@cix.compulink.co.uk (Paul Moore)
- Subject: Use of 'b' templates
- Reply-To: pmoore@cix.compulink.co.uk
- Date: Wed, 9 Sep 1992 23:21:00 +0000
- Message-ID: <memo.619212@cix.compulink.co.uk>
- Sender: usenet@gate.demon.co.uk
- Lines: 24
-
- The subject says it, really. Can somebody tell me how 'b' and 'B' templates
- work, in pack() and unpack()? Preferably with a few examples to make things
- clear.
-
- I have just struggled to an understanding of vec(), but 'b' is beyond me...
-
- [NB: if it matters for examples, my machine stores bytes such that
-
- for $i (0..15)
- {
- print vec('31',$i,1) ? '1' : '0';
- }
-
- gives 1100110010001100]
-
- Thanks in advance for any help...
-
- Gustav.
-
- ---------------------------------------------------------------------------
- Paul Moore (pmoore@cix.compulink.co.uk) |
- ---------------------------------------------------------------------------
- Rimmer directive #271 states just as clearly "No chance, you metal bastard"
- ---------------------------------------------------------------------------
-