http://qs321.pair.com?node_id=88137

shampoo7 has asked for the wisdom of the Perl Monks concerning the following question: (arrays)

I am trying to print an array. But not all the elements are intialize. i.e.
@b[0]=c; @b[1]=undef; @b[3]=undef; @b[4]=a;
so when i use print "@b", I want only @b[0] and @b[4] to be printed. How do I skip the undef elements?

Edited 2001/06/13 by Ovid

Originally posted as a Categorized Question.