in reply to Regexp: not what I'd expected

$bef[$mid] # is an entry out of the array @bef $mid[$aft] # is an entry out of the array @mid $bef[$mid$aft # is a syntax error becuase there's no ] on the array en +try [$bef] # works because they're no other way to look at the [
Look in the Perl docs about how to use arrays and this will make a lot more sense.
The immediate solution is to put a '\' in front of each '['

/\/\averick

Replies are listed 'Best First'.
RE: Re: Regexp: not what I'd expected
by greenhorn (Sexton) on Jul 04, 2000 at 06:32 UTC
    Aha, I have it. sed did it. I was thinking sed-wise. It wouldn't have cared about the un-escaped brackets in the replacement. (Trying to save face...failing...)