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

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

by ColonelPanic (Friar)
on Nov 22, 2012 at 09:20 UTC ( #1005084=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use strict;
    use warnings;
    
    my $string = 'ABCDEFGHIJKL';
    print "$1$2 at ".pos($string)."\n" while ($string =~ /(.)(?=(...))/g);
    
  2. or download this
    print "$1$2 at ". ($-[0] + 1) ."\n" while ($string =~ /(.)(?=(...))/g)
    +;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (14)
As of 2014-07-30 13:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (233 votes), past polls