Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Is it possible to get all tetra words with correct starting position using a better code within a loop?

by GrandFather (Cardinal)
on Nov 22, 2012 at 09:28 UTC ( #1005089=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl  
    use warnings;
    ...
    
    push @tetras, [$1, $+[0] + 1] while $pro =~ /(?=(.{4}))/g;
    print "$_->[0] -> Starting at pos $_->[1]\n" for @tetras;
    
  2. or download this
    ABCD -> Starting at pos 1
    BCDE -> Starting at pos 2
    CDEF -> Starting at pos 3
    DEFG -> Starting at pos 4
    EFGH -> Starting at pos 5
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2014-12-21 20:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (107 votes), past polls