in reply to Remove field inside [ ] brackets

Your string with brackets is being evaluated as a regular expression, not a string. Try using \Q and \E to escape the regular expression-ish characters, e.g.:

if ( /\Q$dpdrivloc\E:\s*(\d+)/ )

Replies are listed 'Best First'.
Re: Re: Remove field inside [ ] brackets
by Anonymous Monk on Mar 24, 2004 at 08:50 UTC
    s/expression-ish characters/meta characters/;#)