Re: Squeezing a list

2002-01-03 Thread Michael R. Wolf
Joshua Colson <[EMAIL PROTECTED]> writes: > @NEWLIST = grep(!/^$/, @LIST); Is there a reason you're using UPPER CASE? It's not *wrong*, it's just more perl-ish style to use lower case. @newlist = grep(!/^$/, @list); And it lets your Shift key last longer :-) -- Michael R. Wolf All

Re: Squeezing a list...

2002-01-03 Thread Matthew Lyon
Yes, I know what grep does... sorry. I was missing some of the programming compactness stuff... On Thu, 3 Jan 2002, Jeff 'japhy' Pinyan wrote: > On Jan 3, Matthew Lyon said: > > >On Thu, 3 Jan 2002, Jeff 'japhy' Pinyan wrote: > > > >> I'd use grep(): > >> > >> @compressed = grep length, @ar

Re: Squeezing a list

2002-01-03 Thread Jeff 'japhy' Pinyan
On Jan 3, Matthew Lyon said: >On Thu, 3 Jan 2002, Jeff 'japhy' Pinyan wrote: > >> I'd use grep(): >> >> @compressed = grep length, @array; >> >> That only allows elements with a non-zero length to get through. > >wait! how does this grep trickery work? where's the circuitry? Uh... it's what

Re: Squeezing a list

2002-01-03 Thread Matthew Lyon
wait! how does this grep trickery work? where's the circuitry? On Thu, 3 Jan 2002, Jeff 'japhy' Pinyan wrote: > On Jan 3, Busse, Rich said: > > >("Abiosdsk", "Afd", "", "", "", "Aha154x", "Aha174x", "aic78xx", "", > >"Alerter", "", "", "", "Always", ...) > > > >Is there a simple way to get rid

Re: Squeezing a list

2002-01-03 Thread Jeff 'japhy' Pinyan
On Jan 3, Busse, Rich said: >("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", "Alw

RE: Squeezing a list

2002-01-03 Thread Joshua Colson
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", "", "",

Squeezing a list

2002-01-03 Thread Busse, Rich
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",