- or download this
sub maxprefix {
my $p = quotemeta shift;
for (@_) { chop $p until /^$p/ }
return $p;
}
- or download this
sub maxprefix {
my $p = shift(@_);
for(@_) { chop $p until /^\Q$p/ }
return $p;
}
- or download this
sub maxprefix {
my $s = reverse shift;
...
chop $p;
return $p;
}
- or download this
print maxprefix("testing","terse","tester","time"),$/;