For the sake of argument we'll assume that you've assigned your list to an
array named @LIST.
Try this.

@NEWLIST = grep(!/^$/, @LIST); # Grep the list for any element that is not
empty.

Now @NEWLIST should only contain those entries that have some content to
them.

Hope this helps.

-----Original Message-----
From: Busse, Rich [mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 03, 2002 7:35 AM
To: Perl Beginners
Subject: Squeezing a list


I have a list that contains some good data and some empty strings, like:

("Abiosdsk", "Afd", "", "", "", "Aha154x", "Aha174x", "aic78xx", "",
"Alerter", "", "", "", "Always", ...)

Is there a simple way to get rid of the empty strings and compress the list
down to:

("Abiosdsk", "Afd", "Aha154x", "Aha174x", "aic78xx", "Alerter", "Always",
.....)

TIA...


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to