Dear Sirs,

Given this array:

my @array = qw (    A  B  C  D  E   );  

I want to enumerate all its possible ranges
throughout the elements. Such that it gives
the following desired answer, that look like this ( I manually crafted it):.

my $ans =       [ 'A',
                  'B', 
                  'C',
                  'D',
                  'E',
                  'AB',
                  'ABC',
                  'ABCD',
                  'ABCDE',
                  'BCD',
                  'BCDE',
                  'CD',
                  'CDE',
                  'DE' ];

Later, I also want to  extend this
to deal with AoA as an input. But with
the same concept.

Is there an efficient way to achieve it? 
I truly do not  know how to go about it.
Really hope to hear from you again.

--
Regards,
Edward WIJAYA
SINGAPORE


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to