Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: How to split an array identified by numbers to get the correct sequence of elements

by trizen (Friar)
on Apr 19, 2012 at 12:17 UTC ( #965934=note: print w/ replies, xml ) Need Help??


in reply to How to split an array identified by numbers to get the correct sequence of elements

my $string = "CCATGNNNTAACCNNATGNNTAGCC"; my @substrings; foreach my $offset ([3, 11], [16, 23]) { push @substrings, substr($string, $offset->[0] - 1, $offset->[1] - + $offset->[0] + 1); } my ($substr1, $substr2) = @substrings; print "$substr1\n$substr2\n";


Comment on Re: How to split an array identified by numbers to get the correct sequence of elements
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (10)
As of 2014-07-23 10:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (139 votes), past polls