Derek B. Smith <[EMAIL PROTECTED]> asked:
> >If you really need to do this in place due to memory constraints, I
> >would advise to run the iteration from back to front, i.e.
> And why would this be? Becasue it does not load the entire
> data set at once or aka one at a time?
grep creates a n
And why would this be? Becasue it does not load the
entire data set at once or aka one at a time?
>If you really need to do this in place due to memory
>constraints, I
>would advise to run the iteration from back to front,
>i.e.
>foreach my $indx (reverse 0..$#$ref_array)
__
Thomas Bätzler wrote:
>
> One possibility that would work is to use
>
> $ref_array = [ grep /^.+$/, @$ref_array ];
It would be more efficient to use the regex /./s or the length function. Your
regex has to match ALL the characters. (And it won't match if there are
multiple lines in the string.
Tova Yaron wrote:
> Hello,
Hello,
> Trying to remove from array blank lines, its look like splice get
> confuse with the array size after removing the blank entry.
> Or maybe I'm getting confuse..
>
>
> use strict;
>
> my ($str0, $str1, $str2, $str3, $str4, $str5, $str6, $str7, $str
"Tova Yaron" schreef:
> Trying to remove from array blank lines, its look like splice get
> confuse with the array size after removing the blank entry.
> Or maybe I'm getting confuse..
When an element is removed, your loop-variable is no longer in sync.
Consider grep:
#!/usr/bin/perl
use w
Tova Yaron <[EMAIL PROTECTED]> wrote:
> Trying to remove from array blank lines, its look like
> splice get confuse with the array size after removing the
> blank entry. Or maybe I'm getting confuse..
> my ($str0, $str1, $str2, $str3, $str4, $str5, $str6, $str7, $str8,
> $str9,)
>
Hello,
Trying to remove from array blank lines, its look like splice get
confuse with the array size after removing the blank entry.
Or maybe I'm getting confuse..
Thanks
Dov
use strict;
my ($str0, $str1, $str2, $str3, $str4, $str5, $str6, $str7, $str8,
$str9,)
=