I have to add a variable value to an array, something like this:
......
@my_array_name = $value_of_this_variable;
This doesnt seem to work, any ideas why?
Thanks!
I have to add a variable value to an array, something like this:
......
@my_array_name = $value_of_this_variable;
This doesnt seem to work, any ideas why?
Thanks!
use this:
unshift( @my_array_name, $value_of_this_variable) ;
works!
Thanks!!!
'unshift' adds to the beginning of an array, 'push' adds to the end of an array.
If you want to assign, its like this:
@array = ($value_of_this_variable,$value_of_this_variable_also);