From: Peter Vanderhaden Date: 2007-11-16T06:34:16+09:00 Subject: Using a variable with gsub & sub In the following statement, I'm replacing ,, with ,NULL,. $inrec = $inrec.sub(',,\\',',NULL,') What I want to do is something like this: $inrec = $inrec.sub(',,\\',',$variable,') Unfortunately, I haven't been able to figure out the syntax for using a variable with sub & gsub. Can someone help me out? Thanks. -- Posted via http://www.ruby-forum.com/.