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
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
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
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
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
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.
-Origina