splice()pop() and shift() are good if you know where the elements you want to remove are. If you want to remove all undefined elements you could use grep@foo = grep {defined} @foo; # Only return elements that are defined
You can replace defined with some other test if your definition of NULL is not definedness.