[Chicago-talk] using a regex in a variable

Jay Strauss me at heyjay.com
Fri Oct 24 08:54:54 CDT 2003


Hi,

If I have:

my $regex = 's/$/_addsomejunk/';
my $str = 'something';

how do I use the $regex on $str to turn $str into "something_addsomejunk";

I've tired various incantations of eval, I think I'm supposed to compile the
regex but if I do qr($regex), then what?

Thanks
Jay








More information about the Chicago-talk mailing list