Hi,

This works but it can't be this easy, so tell this true beginner what's
wrong with it!  I checked it with print "@array\n"; and got an error message
about an "uninitialized value in join or string" I don't know how to deal
with.

@array = (1, 2, 3, 4, 5);
delete $array[2];

Wendy.


"Andrew Mason" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Say I have an array @array = ( 1, 2, 3, 4, 5)

I know I want to remove the second value, $array[2].  How should I do
this?

Is it possible to issue a command that just does this for me or do I
have to loop through setting $array[n]=$array[n+1] for n>which ever
value I wish to remove?  (I hope that makes sense).

The second solution whilst effectively removing the unwanted element
would mean that the end of my array was filled with duplicates or
rubbish, so isn't really a solution unless I can then tidy it up
somehow.

TIA

Andrew



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to