in reply to want regex to strip "(xxx)"

You should try something like
$_ =~ s/\(.*\)//g;
But why don't you read some stuff about regexprs like Japhy's excellent Perl-Regexpr-Book?

giant

Replies are listed 'Best First'.
Re^2: regex
by Aristotle (Chancellor) on Jul 23, 2002 at 14:57 UTC
    I'm not sure he really wants an unanchored regex with /g.. it might have some surprising effects down the road. Note that since you're using .*, so long as the variable contains a single line at a time, the /g won't do anything since the regex machine will match the entire string from the first opening to the last closing paren. As a minor point, if you're substituting against $_ you needn't spell out the variable with =~; although you may have chosen to do so for clarity.

    Makeshifts last the longest.

      Yep I know. That's why i wrote "something like". Because it's not meant to be used as it is, just something like to show what the way could be. I think it's better to show people the "way" how they can learn stuff and not give them code, where they don't know what it's doing. Better to give them a "hint" & some docu so they don't ask the same thing again in an hour just with a different content (that's what's happening pretty often these days)...

      giant
        Yes, but your code is not unusable as is and to the uninitiated it will appear to do what is desired. So he may just unsuspectingly copy it and run into problems a lot later. If you don't want him to come back 10 minutes later with the next question, give him a proper example and explain it in at least some detail instead. :)

        Makeshifts last the longest.