Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Trouble understanding pack/unpack syntax.

by grep (Monsignor)
on Jul 02, 2007 at 03:36 UTC ( #624368=note: print w/ replies, xml ) Need Help??


in reply to Trouble understanding pack/unpack syntax.

but my suspicion is that the A16 will give me 16 separate array elements

Why would you think that? Test it out.

#/usr/bin/perl use strict; use warnings; use Data::Dumper; my $line = "FooBarBaz"; my @array = unpack('A3A3A3',$line); print Dumper \@array;
Produces:
$VAR1 = [ 'Foo', 'Bar', 'Baz' ];
So A16 will produce 1 element.

As to your signature: I would suggest reading something I wrote earlier.


Comment on Re: Trouble understanding pack/unpack syntax.
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://624368]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (12)
As of 2015-07-30 19:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (273 votes), past polls