Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
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 having an uproarious good time at the Monastery: (10)
As of 2014-11-26 01:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (160 votes), past polls