Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
which producesuse strict; use Data::Dumper; my (@array,@newarray); @array=("ABCDEF01","HIJKL678","VWXYZ123H"); foreach my $val (@array) { print " USERNAME like '"; print substr($val,0,4); print "%' OR +"; }
The problem I'm having is that I don't want the final OR to be printed and I'm not sure how to put the result into a string so I end up with
$string="USERNAME like 'ABCD%' OR USERNAME like 'HIJK%' OR USERNAME like 'VWXY%"
Any help appreciated
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: covert to string variable
by choroba (Cardinal) on Oct 28, 2010 at 14:21 UTC | |
|
Re: covert to string variable
by Marshall (Canon) on Oct 28, 2010 at 14:36 UTC | |
|
Re: covert to string variable
by james2vegas (Chaplain) on Oct 28, 2010 at 16:17 UTC | |
by Anonymous Monk on Oct 29, 2010 at 14:01 UTC | |
|
Re: covert to string variable
by Your Mother (Archbishop) on Oct 28, 2010 at 16:57 UTC | |
|
Re: covert to string variable
by Anonymous Monk on Oct 28, 2010 at 17:18 UTC |