Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Pulling bytes out of string

by Kenosis (Priest)
on Oct 21, 2015 at 19:35 UTC ( [id://1145585]=note: print w/replies, xml ) Need Help??


in reply to Pulling bytes out of string

One option is to use a regex to match just two chars at a time--globally--and place the results into an array:

use strict; use warnings; my $string = '8602353907455755'; my @arr = $string =~ /../g; print "@arr";

Output:

86 02 35 39 07 45 57 55

Hope this helps!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2024-04-19 08:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found