in reply to Simple re question

I don't know for sure where you are going with this, but the code as you have it won't work. as you are missing the tilde after the $line= in both your conditionals. Anyhow I think this is what you meant:
my $line='0x160001a \"fubar - BlahBlahBlah - Blah Blah (1:23)\": ("Foo +" "Bar") Baz'; if ($line=~/\)/){ $line="$`)"; } if ($line=~/-\s/){ $line=$'; }
But as anything else you can always set the values of $' and $` to a variable and use those variables later on:
use strict; use warnings; my ($prematch,$postmatch); my $line='0x160001a \"fubar - BlahBlahBlah - Blah Blah (1:23)\": ("Foo +" "Bar") Baz'; if ($line=~/\)/){$line="$`)"; $prematch = $`;} if ($line=~/-\s/){$line=$'; $postmatch = $';} print $prematch,$/; print $postmatch,$/; print $line,$/;
And you can use both $' and $` after you get a successful match in the current dynamic scope (as long as you are still in the current dynamic scope). Though I would probably solve the problem differently than you are doing by the same reasoning as you above.

Here comes my simple question: since the first - occurs before the values that I want, and because the first ) occurs afterwards,

use strict; use warnings; my $line='0x160001a \"fubar - BlahBlahBlah - Blah Blah (1:23)\": ("Foo +" "Bar") Baz'; if ( $line =~ /- ([^\)]+\))/ ) { print $1; $line = $1;}
which captures in $1 what you described, and doesn't suffer from the performance penalty of using $' or $`

-enlil