[Israel.pm] sliding window on streaming lines

Gaal Yahas gaal at forum2.org
Sun Jun 6 03:25:10 PDT 2004


On Sun, Jun 06, 2004 at 10:02:53AM +0300, Shlomo Yona wrote:
> I don't think I understnd you.
> 
> Here's an example:
> 
> 	my $lattice = [
> 		{
> 			foo => 1
> 		},
> 		{	
> 			moo => 1,
> 			miau => 0,
> 			blah => 0
> 		},
> 		{
> 			bar => 0,
> 			baz => 1
> 		}
> 	];

Think of a numerical lock, like the one on a suitcase. It has three
spinning wheels -- on a suitcase they usually all go from 0 to 9, but
here the first one only has "foo"; the second has "moo", "miau", and
"blah"; and the last has "bar" and "baz".

If this were a normal suitcase lock, you'd want to see 000, 001, 002,
... 010, 011, ... 999. This isn't numeric, so you want foo/moo/bar,
foo/moo/baz, foo/miau/bar, ... foo/blah/baz.

-- 
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/



More information about the Perl mailing list