Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Grep Pattern

by rsFalse (Hermit)
on Dec 15, 2018 at 20:06 UTC ( #1227304=note: print w/replies, xml ) Need Help??


in reply to Grep Pattern

Another one, with rotating:
#!/usr/bin/perl # https://perlmonks.org/?node_id=1227147 use warnings; use strict; my $short_pattern = 'FTTF'; my @result = grep { $short_pattern = ( chop $short_pattern ) . $short_patt +ern; $short_pattern ge 'T' } 0 .. 12; print "@result\n";
P.S. note a wrong rotation direction. So, the pattern should be reversed before, if it's not a palindrome.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2020-09-28 19:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (144 votes). Check out past polls.

    Notices?