[PHP-users 9327] Re: $BG[Ns$K$D$$$F(B
HASEGAWA Nobuaki
php-users@php.gr.jp
Fri, 16 Aug 2002 14:02:33 +0900
Tatsuya Kondo$BMM!"(B
perl$B$G$9$7!"$b$&>/$7%9%^!<%H$K=q$1$=$&$J5$$b$7$^$9$,!"(B
%a = ('a'=>1, 'b'=>1, 'c'=>1, 'd'=>1, ''=>1);
selectone( '', %a);
sub selectone {
my ($var, %rest) = @_;
for (keys %rest) {
if ($_ eq '') {
print "$var\n"
} else {
my %t = %rest;
delete $t{$_};
selectone( $var . $_, %t)
}
}
}
$B$H$+!#(B
selectone$B$H$$$&4X?t$O!"(B
$B3NDj$7$F$$$kG[Ns(B $var $B$H(B $B=*E@(B('')$B$r4^$`;D$j$NG[Ns(B($BMWAG$rH4$-$d$9$$$h$&(B
$B%O%C%7%e$K$7$F$^$9$,(B) %rest $B$r0z?t$K!"(B
$B;D$j$NG[NsMWAG$r=g$K<h$j=P$7$F!"$=$l$,=*E@$G$"$l$P=q$-=P$7!"(B
$B$=$&$G$J$1$l$P3NDjItJ,$KDI2C$7$F;D$j$NG[Ns$+$i=|$-!"$=$l$r0z?t$H$7$FF1(B
$B$84X?t$r:F5"E*$K8F$S=P$9!#(B
$B%"%k%4%j%:%`Cf?4$N;29M=q$K$"$j$=$&$J2rK!$G$9$,!D!D!#(B
On Fri, 16 Aug 2002 13:10:30 +0900
"Tatsuya Kondo" <konet@zc.wakwak.com> wrote:
>php$B$G$J$/$F$b(Bperl$B$G$b9=$$$^$;$s!#(B
>$B2?$+%R%s%H$,$"$l$P$=$3$+$i<+J,$J$j$K(B
>php$B$KCV$-49$($F$d$C$F$_$^$9!#(B
---
$BD9C+@nD*><(B $B%7%9%F%`E}3gK\It%7%9%F%`E}3gIt%7%9%F%`(B2$B2](B
($B3t(B)$BKhF|%3%_%e%K%1!<%7%g%s%:(B