in reply to creating word from array of array
@characters = ( [ "h" ], [ "e" ], [ "l", "p", "i" ], [ "l" ], [ "o" ], ); sub spell{ my $prefix = shift; my @c = @{+shift}; unless( @c ){ return print "$prefix\n"; } foreach( @c ){ spell("$prefix$_",@_); } } spell("",@characters);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: creating word from array of array
by dvergin (Monsignor) on Feb 16, 2002 at 23:15 UTC | |
by screamingeagle (Curate) on Feb 17, 2002 at 01:54 UTC |