On 2011-07-19 21:23, Steven Surgnier wrote:
I desire a concise conditional statement which simply checks if each entry
in an array matches a given string. For example:
print "all the same" if (grep {m/test_name/} @bins) == scalar @bins);
Your match is not anchored, so ITYM:
my $s = $bins[
Steven Surgnier wrote:
Hi,
I desire a concise conditional statement which simply checks if each entry
in an array matches a given string. For example:
print "all the same" if (grep {m/test_name/} @bins) == scalar @bins);
#END CODE
I thought, "grep will return the number of matches, so why no
> -Original Message-
> From: Steven Surgnier [mailto:ssurgn...@gmail.com]
> Sent: Tuesday, July 19, 2011 3:24 PM
> To: beginners@perl.org
> Subject: grep question
>
> Hi,
>
> I desire a concise conditional statement which simply checks if each
> entry
> in an array matches a given string.
On Tue, Jul 19, 2011 at 4:23 PM, Steven Surgnier wrote:
> Hi,
>
> I desire a concise conditional statement which simply checks if each entry
> in an array matches a given string. For example:
>
> print "all the same" if (grep {m/test_name/} @bins) == scalar @bins);
>
> #END CODE
>
> I thought, "g
Hello,
you can use
print "all the same" unless (grep {! /test_name/} @bin);
2011/7/19 Steven Surgnier
> Hi,
>
> I desire a concise conditional statement which simply checks if each entry
> in an array matches a given string. For example:
>
> print "all the same" if (grep {m/test_name/} @bins)
David Gilden schreef:
> my $Comments = param('(Comments');
There is an extra '(' in there that you might not want.
Do you use Capitalization to show that the variable is initialised with
the value of a parameter?
Consider $p_comments or $param_comments or $param{Comments}.
--
Affijn, Ruud
"Ge
Steve Bertrand wrote:
David Gilden wrote:
Could someone please help me the syntax here
my $Comments = param('(Comments');
&BADemail if ($Comments =~ /[virtualthirst.com|napavalleycf.org]/ig);
This should go to &BADemail if $Comments contains either string,
regardless else is contained i
David Gilden wrote:
Could someone please help me the syntax here
my $Comments = param('(Comments');
&BADemail if ($Comments =~ /[virtualthirst.com|napavalleycf.org]/ig);
This should go to &BADemail if $Comments contains either string, regardless
else is contained in the $Comments.
In a
David Gilden wrote:
>
> my $Comments = param('(Comments');
> &BADemail if ($Comments =~ /[virtualthirst.com|napavalleycf.org]/ig);
>
> This should go to &BADemail if $Comments contains either string, regardless
> else is contained in the $Comments.
The answer to your question is
BADemail()