On 2012-07-19 12:37, punit jain wrote:
if( @folders ) {
map {$query .= "not in:$_ and"; } @folders;
print "\n $query \n";
}
'if' is not a function, so put a white space after it.
But in this case you don't need the 'if' at all.
Don't use map in void context.
Alternative code:
for my $f ( @folders ) {
$query .= "not in:$f and";
print "\n $query \n";
}
For some reason you print with every iteration. Why?
$query .= join " and ", map "not in:$_", @folders;
I don't know what syntax you have, but normally an 'in' operator
processes a list.
$query .= "not in:'. join( ":", @folders );
--
Ruud
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/