in reply to Modification of non-creatable array

My guess is that
@msg2 =$gsm->messages('SM');

didn't return any messages, which means that $#msg2 is -1.

Update:

And at line 94...

my $dernier_num = $msg2[$#msg2]->sender(); # ^^^^^^

You're trying to access the last element of an empty array!

Replies are listed 'Best First'.
Re^2: Modification of non-creatable array
by Anonymous Monk on May 20, 2010 at 12:23 UTC
    the @msg2 is's not empty, the probleme was to get out of the loop.thank you funkymonk