Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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 wandering the Monastery: (7)
As of 2023-02-02 15:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I prefer not to run the latest version of Perl because:







    Results (19 votes). Check out past polls.

    Notices?