- insert and delete elements at the front of arrays
- insert and delete elements at the end of arrays
|
@inventory = ('batteries', 'fluids', 'bolts');
push (@inventory, 'cables'); |
$complex = { 'monday' => ['ford', 'bmw'],
'tuesday' => ['honda', 'toyota'],
};
# does NOT work
push (@$complex->{'monday'}, 'mercedes');
# DOES work
push (@{$complex->{'monday'}}, 'mercedes');
|