[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Recursion, anyone?



On Wed, Apr 11, 2001 at 04:49:14PM -0400, Yanick Champoux wrote:
> #!/usr/bin/perl
> @e=(A..Z,a..z,0..9,'-');@i=(0)x shift;$\="\n";while($f=1){print@e[@i];
> map{$f&&((++$i[$_]>@e?$i[$_]:$f)=0)}0..@i-1;$f&&exit;}

Hmmm... Way too verbose.

#!/usr/bin/perl
@e=(A..Z,a..z,0..9,'-');@i=(0)x shift;$\="\n";while($f=1){print@e[@i];
$f&&((++$_>@e?$_:$f)=0)for@i;$f&&exit}


is slightly better.

Joy,
`/anick

-- 
($a,$z)=(sort split'',$_=';/ t3&% ,/"tD/"(t,31)/"f')[0,-1];
s/./chr(ord($z)-ord($&)+ord$a)/eg;print

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe