please help me to find the solution of this error
1-
Modification of non-creatable array value attempted,
subscript -1 at research.pl line 94.
############################################
# VARIABLES
############################################
....
# array scotching sms which was readed
my @msg2 = ();
..........
############################################
# START EXECUTION
############################################
answer_sms();
###########################################
# answer_sms()
###########################################
sub answer_sms
{
#Build gsm object
$gsm = new Device::Gsm(port=>'/dev/cuaU0');
# read SMS of Sim card
@msg = $gsm->messages('SM');
# get the number of sms in the card
$taille = @msg;
# read the old sms in my sim card
proc_read_card();
# creat array for stoching nmbr of sms in the card
@tab=($taille);
print "\nWAITING FOR NEW SMS.......\n";
while(1)
{
my $newtime = (time+50);
@msg2 =$gsm->messages('SM');
$taille2 = @msg2;
push(@tab,$taille2);
if($tab[-1] != $tab[-2])
{
# get the number of the last sender
# following the LINE 94#
my $dernier_num = $msg2[$#msg2]->sender();
................
$gsm->send_sms(recipient=>$dernier_num,content=>"Error"
+);
.............
}
}
when the last line is executed i get the error.
Thank you in advance