Hello Sunita,

I'm replying to the list because I assume your question was meant to be public. 

On Fri, 2 Dec 2011 04:14:47 -0500
<[email protected]> wrote:

> Thank you Fish . I think , my question was not clear enough . In the array 
> "@array = 
> ("0A0", "005", "001", "004", "0BC", "004", "002", "001");"  , "0BC" does not 
> have 
> consecutive pair , still I want it inside array(push to array). It is not 
> happening .
> 

First of all, you should call me either "Mr. Fish" or "Shlomi". See:

* http://www.joelonsoftware.com/articles/ResumeRead.html

* http://www.shlomifish.org/meta/FAQ/#refer_or_address

Afterwards, you can easily detect disjoint values by sorting the array first
and then iterating over it by indexes to find its ranges:

http://perldoc.perl.org/functions/sort.html

> 1. You don't need the "next" here.
> 
> >> What should I use instead of next?
> 

You shouldn't use anything - just omit the final else { .. } clause.

Regards,

        Shlomi Fish

> -Sunita
> 

-- 
-----------------------------------------------------------------
Shlomi Fish       http://www.shlomifish.org/
Rethinking CPAN - http://shlom.in/rethinking-cpan

Microsoft — making it all make sense. Ours.

Please reply to list if it's a mailing list post - http://shlom.in/reply .

--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/


Reply via email to