cthar has asked for the wisdom of the Perl Monks concerning the following question:
How do we add element to an array only if the element is non-empty? ie.... i have a list of element:
... etc so i want to add only a, b, c and d, ignoring the blank spaces. i tried:a b c d a a c d c
what am i doing wrong? thanks.unless($list eq " ") { push(@array, $list); }
Again... i dont want to store/add the repeated element.... ie my array will contain only a, b , c and d. Thanks.
Back to
Seekers of Perl Wisdom