[cgiapp] Help with m// needed

Barry Moore barry.moore at genetics.utah.edu
Fri Mar 7 00:19:03 EST 2008


Hi Lou,

You've got your variables around backwards. For that to match you need:

$regexp = 'French';
$variable = 'French:6:47';

if ($variable =~ /$regexp/) {
	print "This works\n";
}

BTW, this mailing list is specifically for CGI::Application issues,  
and it's members will generally refer you to something like Perl  
Monks for general perl questions like this one.

Barry


On Mar 6, 2008, at 10:06 PM, Lou Hernsen wrote:

> I am trying to match
> French
> in the string
> French:6:47
> The code is
>
> if ($PFile{Allied} =~ m/$Port/)
>
> and the actual vars would be
>
> if (French =~ m/French:6:47/)
>
> and there should be a match!!!!
> but
>
> but it doesn't work.. and I don't see why....
> I have used m// before the never had this problem...
>
> Help? thanks
> Lou
> Perl is my HOBBY... just something to keep my mind sharp.
>
> #####  CGI::Application community mailing list  ################
> ##                                                            ##
> ##  To unsubscribe, or change your message delivery options,  ##
> ##  visit:  http://lists.openlib.org/mailman/listinfo/cgiapp    ##
> ##                                                            ##
> ##  Web archive:   http://lists.openlib.org/pipermail/cgiapp/   ##
> ##  Wiki:          http://cgiapp.erlbaum.net/                 ##
> ##                                                            ##
> ################################################################
>



More information about the cgiapp mailing list