Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Possible unpack modification (or module)

by samurai (Monk)
on Sep 30, 2002 at 15:31 UTC ( [id://201744]=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    my @fields     = qw/ name sex age salary sign /;
    my $unpack_tpl = "A20 A1 A3 A8 A12";
    my %data = ();
    @data{ @fields } = unpack $unpack_tpl, $string;
    # { name => "Ted", sex => "M" ... }
    
  2. or download this
    my $unpack_tpl = "A20name A1sex A3age, A8salary, A12sign";
    my %data = unpack2 $unpack_tpl, $string;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlmeditation [id://201744]
Approved by fireartist
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-03-29 01:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found