I have the following code that I keep getting this error on: Useless use of a constant in void context at ...
I've highlighted the lines it has a problem with. What exactly does this mean and how do I get rid of the error/warning?
I've highlighted the lines it has a problem with. What exactly does this mean and how do I get rid of the error/warning?
Code:
my @promocodes = qw/code1 code2 code3 code4 code5/;
my @bind_params;
if ( @promocodes )
{
my $col_beg = "c.p_model";
my $col_end = "ind";
for (my $i = 1; $i < 21; $i++)
{
my $num = sprintf '%02s', $i;
my $newcol = $col_beg . $num . $col_end;
if ($i == 1)
{
[COLOR=red]$qry .= " AND \(\($newcol IN (" . join( ', ', ('?') x @promocodes ) . ')',"\n";[/color]
}
elsif ($i > 1 && ($i < 20))
{
[COLOR=red]$qry .= " OR $newcol IN (" . join( ', ', ('?') x @promocodes ) . ')',"\n";[/color]
}
else
{
[COLOR=red]$qry .= " OR $newcol IN (" . join( ', ', ('?') x @promocodes ) . ')))',"\n";[/color]
}
foreach my $element ( @promocodes )
{
push @bind_params, $element;
}
}
}
print $qry;
[/code/