Lacking any hint of how you've code the script, it's hard to be confident that my first suggestion -- that you use NON-INTERPOLATING SINGLE QUOTES (') -- will solve your problem... but it might, as might Corion's re quotemeta.
Comment on Re^3: replacing "\L" character in strings