[Chicago-talk] using a regex in a variable

Jay Strauss me at heyjay.com
Fri Oct 24 09:16:23 CDT 2003


Oh, I can do that... Just joking

Because I need to be able to dynamically use a different regex (which I look
up in my db) under different conditions

Jay
----- Original Message -----
From: "Ed Summers" <ehs at pobox.com>
To: "Chicago.pm chatter" <chicago-talk at mail.pm.org>
Sent: Friday, October 24, 2003 9:12 AM
Subject: Re: [Chicago-talk] using a regex in a variable


> On Fri, Oct 24, 2003 at 08:54:54AM -0500, Jay Strauss wrote:
> > my $regex = 's/$/_addsomejunk/';
> > my $str = 'something';
> >
> > how do I use the $regex on $str to turn $str into
"something_addsomejunk";
>
> Why not just use concatenation?
>
>     $str .= '_addsomejunk';
>
> //Ed
> _______________________________________________
> Chicago-talk mailing list
> Chicago-talk at mail.pm.org
> http://mail.pm.org/mailman/listinfo/chicago-talk
>
>




More information about the Chicago-talk mailing list