rohan_532 has asked for the wisdom of the Perl Monks concerning the following question:
can i compare individual string with complete array i am comparing excel row with array using the following way, description variable contains string to match with @steps_name array
my @steps_name=("1-2 Steps", "5-7 Steps", "8-10 Steps", "11-15 Steps") +; foreach $sheet (@{$workbook->{Worksheet}}) { foreach $col ($sheet->{MinCol} .. $sheet->{MaxCol}) { if ($sheet->{Cells}[0][$col]->{Val} eq "DESCRIPTION") { $description = $col; } } foreach $row ($sheet->{MinRow}+1 .. 50) { my $db_description = $sheet->{Cells}[$row][$description]->{ +Val}; my $needle_regex = quotemeta $db_description; if (grep { /(?i)\Q$db_description\E/ } @steps_name) + { print "<br><h1>Element '$db_description' found $st +eps_name[$row+1] --- $seq_code[$row+1] !</h1></br>" ; } else { print "<br>$db_description not found </br>" } push(@excel_array,$db_description); }## end of for each }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: compare individual string with complete array
by thanos1983 (Parson) on May 31, 2017 at 09:46 UTC | |
by rohan_532 (Initiate) on May 31, 2017 at 10:44 UTC | |
by thanos1983 (Parson) on May 31, 2017 at 11:15 UTC | |
by rohan_532 (Initiate) on May 31, 2017 at 11:38 UTC | |
by thanos1983 (Parson) on May 31, 2017 at 12:49 UTC | |
| |
|
Re: compare individual string with complete array
by AnomalousMonk (Archbishop) on May 31, 2017 at 20:10 UTC | |
|
Re: compare individual string with complete array
by locked_user sundialsvc4 (Abbot) on May 31, 2017 at 16:48 UTC |