Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: How to run index on this one?

by bichonfrise74 (Vicar)
on Nov 25, 2009 at 22:41 UTC ( [id://809450]=note: print w/replies, xml ) Need Help??


in reply to How to run index on this one?

Another way...
#!/usr/bin/perl use strict; my $string = 'YYSFTVMETDPVN[115]HMVGV' . 'ISVEGRPGLFWFN[115]ISGGDK'; my @pos; my $test = 'N[115]'; for ( my $i = 0; $i < length( $string ); $i++ ) { push( @pos, $i ) if ( substr( $string, $i, 6 ) eq $test ); } @pos = map { $_ == 0 ? $pos[$_] : $pos[$_] - 5 } (0 .. $#pos ); print "Found N at positions: ". join( ', ', @pos ), "\n";

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-16 10:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found