Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: splitting an array element

by impossiblerobot (Deacon)
on Nov 25, 2002 at 15:31 UTC ( [id://215642]=note: print w/replies, xml ) Need Help??


in reply to splitting an array element

When I think of fixed-length fields, I always think of unpack:
my $data = '19600326'; print join('-', unpack('A4A2A2', $data));
or
my $data = '19600326'; printf ('%s-%s-%s', unpack('A4A2A2', $data));

Update: Ack! Zaxo beat me to it by a couple of minutes. :-)


Impossible Robot

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others musing on the Monastery: (2)
As of 2024-04-20 04:48 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found