why not just do

$somestring =~ s!>!)!g;

that will replace every ">" with a ")". This way you do not even have to
worry about $stringlength.

> -----Original Message-----
> From: Dan [mailto:[EMAIL PROTECTED]]
> Sent: Friday, September 07, 2001 11:15 AM
> To: [EMAIL PROTECTED]
> Subject: general multipliers in a substitution regexp..
> 
> 
> Hi perlers,
> 
> If I have a string with say a number of '>>>>>>' in it which may be
> variable in length and I wish to write a regexp to match and 
> replace it
> with the equivalent number of ')'s [ie >>>> would become ))))]
> 
> I can use $somestring =~ s/\>{$stringlength}/[help!]/g;
> as a matching operator - but why doesn't the general 
> multiplier seem to
> work when I try a s/\>{$stringlength/\){$stringlength}/g;
> what I get is {$stringlength} in the output - with the value of
> $stringlength (in curly brackets!) even though the match works fine...
> 
> this seems counterintuitive to me - but I'm probably missing the point
> (again!).
> Is there a perlism I'm missing? Or a better way to do it...
> 
> cheers guys!
> 
> dan
> 
> ____________________________________________________________
> Do You Yahoo!?
> Get your free @yahoo.co.uk address at http://mail.yahoo.co.uk
> or your free @yahoo.ie address at http://mail.yahoo.ie
> 
> -- 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

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

Reply via email to