F
Frederik Vanderstraeten
Hi
I'm new to Perl. I have a question about array references: what's the
best way to use them? How do I add an element, remove an element, ... Is
dereferencing the best way?
E.g., what is the easiest way to rewrite this:
$arrayRef = $obj->get('myArray');
@array = $@arrayRef;
@array = (@array, 'newElement');
$obj->set('myArray', \@array);
As get returns a reference, I assume I could easily do all of this in
one statement.
I'm new to Perl. I have a question about array references: what's the
best way to use them? How do I add an element, remove an element, ... Is
dereferencing the best way?
E.g., what is the easiest way to rewrite this:
$arrayRef = $obj->get('myArray');
@array = $@arrayRef;
@array = (@array, 'newElement');
$obj->set('myArray', \@array);
As get returns a reference, I assume I could easily do all of this in
one statement.