On Mon, 10 Jan 2005 22:11:59 +0100, Hendrik Maryns
<> wrote:
>I was wondering wether there is an easy way to eliminate all undefined
>or empty elements of a list, except from skipping through it with a
>foreach loop and rebuilding it. So, if I had a list like this:
>
>(5,"jan","",$whatever,undef,undef,"someotherstrin g")
>
>The result should be
>
>(5,"jan",$whatever,"someotherstring")
my @newlist = grep $_, @oldlist;
# perldoc -f grep
HTH,
Michele
--
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
..'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,
|