Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
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 browsing the Monastery: (7)
As of 2014-12-27 02:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls