Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Dividing a string into multiple substrings of different length

by BrowserUk (Patriarch)
on Jan 04, 2015 at 05:37 UTC ( [id://1112096]=note: print w/replies, xml ) Need Help??


in reply to Dividing a string into multiple substrings of different length

This:

my $BoardTotal = $B10->to_base(substr($DC,0,4)); my $AvgSample = $B10->to_base(substr($DC,4,2)); my $Level = $B10->to_base(substr($DC,6,2)); my $Exp = $B10->to_base(substr($SC,8,5)); my $Fails = $B10->to_base(substr($DC,13,2));

Can also be done like this:

my( $BoardTotal, $AvgSample, $Level, $Exp, $Fails ) = map $B10->to_bas +e( $_ ), unpack 'A4 A2 A2 A5 A2', $DC;

With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

Log In?
Username:
Password:

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

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

    No recent polls found