use warnings; use strict; my %ch; my $part; my $lines; while (<DATA>) { chomp; $part=""; map { $part .= $_; print $part."\n"; $ch{$part}++; } split (//); $lines ++; } my $max; foreach (keys (%ch) ) { if ( ($ch{$_} == $lines) and (length($_) > length($max)) ) { $max = $_; } } print $max; __DATA__ abcdefg abcd abcd grtf abcd abd abcd daf
In reply to Re: identifying arbitury patterns in multiple strings
by si_lence
in thread identifying arbitury patterns in multiple strings
by westernflame
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |