Thanks a lot john..

-----Original Message-----
From: John W. Krahn [mailto:[EMAIL PROTECTED] 
Sent: 13 October 2005 15:48
To: Perl Beginners
Subject: Re: how to find missing value.


Pant, Hridyesh wrote:
> 
> From: John W. Krahn [mailto:[EMAIL PROTECTED] 
>> 
>> Jabir Ahmed wrote:
>> 
>>>I need to know the best way to get a missing element
>>>from an array.
>>>
>>>i have an array @a of size containing values 1 to 101 
>>>with one value missing.
>>>
>>>eg: @a=qw( 1 2 3 4 5 6 8 9 10 .... 101);
>>>
>>>(the array is not sorted and its only to make it
>>>easier to understand)
>>>
>>>now i need to find out the missing value i.e 7 .
>> 
>> $ perl -le'
>> my @x = 1 .. 101;
>> my @y = ( 1 .. 53, 55 .. 101 );
>> 
>> my %z;
>> @z{ @x } = ();
>> delete @z{ @y };
>> print for keys %z;
>> '
>> 54
> 
> I am new for perl and I am going through the perl reference. but I am
> not able to understand below line
> @z{ @x } = ();

That is a hash slice and it is described in the "Slices" section of the
perldata.pod file.

perldoc perldata


> Also could you please guide me where can I get these hidden topic
about
> perl's reference.

Which hidden topic?  Perhaps these will help:

perldoc perl
perldoc perltoc



John
-- 
use Perl;
program
fulfillment

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


--
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