in reply to match sequences of words based on number of characters
add use re 'debug'; to see what the regex engine is doing, and why your match fails
Then, use my @list = grep $lengthy, split /\W/, $str
Where
or whatever counting logic you requiremy $lengthy = do { my @lengths = ( 2, 6, 6 ); my $lix = 0; sub { if( $lix < @lis and $lengths[ $lix ] == length $_ ){ $lix++; return !!1; } return !!0; } };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: match sequences of words based on number of characters
by AnomalousMonk (Archbishop) on Feb 17, 2013 at 20:09 UTC | |
by nicemank (Novice) on Feb 17, 2013 at 21:31 UTC | |
by AnomalousMonk (Archbishop) on Feb 17, 2013 at 21:56 UTC | |
by Anonymous Monk on Feb 18, 2013 at 00:17 UTC | |
by Anonymous Monk on Feb 18, 2013 at 00:28 UTC |
In Section
Seekers of Perl Wisdom