[Chicago-talk] using a regex in a variable

Ed Summers ehs at pobox.com
Fri Oct 24 09:12:36 CDT 2003


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



More information about the Chicago-talk mailing list