Johan Meskens CS3 jmcs3
<mailto:[EMAIL PROTECTED]> scribbled on
Saturday, April 22, 2006 5:26 PM:

> hello 
> i want to delete an element from an anonymous array in a hash with:
> 
> delete ${$alltheworlds{ $d }}[$num];

perldoc -f splice.

my $deleted_element = splice(@{$alltheworlds{ $d }} , $num, 1); 

should do the trick.

> now instead of being being deleted it turns out be 'undef'
> 
> and
> my @array = ( undef, "one", "two" );
> print scalar @array gives :3

undef is a legal value for an array element.

> so the element is only "half" deleted

I do not think there is such thing as half deleted. 
Its either deleted or not deleted.

--Ankur

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