note
BKB
Running the previous version of code:
<code>
perl arraydelete.pl
Use of uninitialized value within @x in print at arraydelete.pl line 6.
1245
</code>
Modified as follows using "exists":
<code>
#! perl
use warnings;
use strict;
my @x = (1,2,3,4,5);
delete $x[2];
for (0..4) { print $x[$_] if exists ($x[$_]) }
</code>
Run it to produce:
<code>
perl arraydelete.pl
1245
</code>
676326
676658