Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Pulling bytes out of string

by Kenosis (Priest)
on Oct 21, 2015 at 19:35 UTC ( #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? | Other CB clients
Other Users?
Others about the Monastery: (4)
As of 2021-09-28 13:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?