くだすれPerl(超初心者用)3
■ このスレッドは過去ログ倉庫に格納されています
0196nobodyさん
2009/08/06(木) 23:46:37ID:???sub start {
my ($item, $sub) = @_;
return sub{
my ($str) = @_;
my $start = 0;
while((my $new = index($str, $item, $start)) >= 0){
$start = $new+length($item);
$sub->(\$str, $start, length($str), $item);
}
};
}
sub without {
my ($item, $sub) = @_;
return sub{
my ($str, $start, $end, $result) = @_;
my $new = index(${$str}, $item, $start);
$end = $new if ($new >= 0 && $new < $end);
$sub->($str, $start, $end, $result);
};
}
■ このスレッドは過去ログ倉庫に格納されています