On Wed, Mar 06, 2002 at 10:50:34AM -0800, Pradeep Sethi wrote:
> 
> Hi All,
> 
> I have a string
> 
> $str="first value %s and second is %s, substitute them";
> 
> and an array @vars=('I', 'II');
> 
> i want to substitute the array with the respective values
> 
> any regular expression or join etc ?

Someone has carefully set up your string for use with printf, so it
would be rude not to :-)

$str = sprintf $str, @vars;

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to