Use of uninitialized value in join or string at arraydef.pl

When try to execute the following script, its throwing this error:
" Use of uninitialized value in join or string at arraydef.pl line 17. "

The script is [ i am pasting with line numbers]:

1 #!/usr/bin/perl
2
3 use strict;
4
5 my @a = ( 1...10 );
6
7 print " Original array : @a \n ";
8
9 #DELETE Function
10
11 my $size=@a;
12
13 print "size of arry before deleting 1st element : $size \n ";
14
15
16 delete($a[0]); #Deleting 1st element
17 print " Array after deleting first element : @a \n ";
18 $size=@a;
19 print "size of arry after deleting 1st element : $size \n "; # size dont differ wen we delete 1st or middle ,,. It differs only wen we delete last element.
20
21 delete($a[$size-1]);
22 print " Array after deleting last element : @a \n ";
23 $size=@a;
24 print "size of arry after deleting last element : $size \n ";

delete (something) makes "something" undefined

praveen, try shift function on that array

but how to get rid of that error?

Yogesh gave you the answer. shift the array. If you don't like that then tell us what your requirements are. IN other words what are you trying to do with the perl code...

According to the POD, for an array element, delete() sets the element to undef. So $a[0] will be undef. print @a will then give a warning (not error) if warnings are enabled.