in reply to warning using a regexp

If you get a warning that you don't understand it's always worth adding "use diagnostics" to your program to get a more details error. You'll see something like this:

False [] range "%s" in regex; marked by <-- HERE in m/%s/
(W regexp) A character class range must start and end at a literal character, not another character class like \d or :alpha:. The "-" in your false range is interpreted as a literal "-". Consider quoting the "-", "\-". The <-- HERE shows in the regular expression about where the problem was discovered. See perlre.

--
<http://www.dave.org.uk>

"The first rule of Perl club is you do not talk about Perl club."
-- Chip Salzenberg

Replies are listed 'Best First'.
Re: Re: warning using a regexp
by elbow (Scribe) on Jan 10, 2003 at 11:40 UTC
    Dave

    just wanted to say thanks for the heads up on 'use diagnostics' - never seen it before and have just tried it out. As a novice that could be loads of help in the future!

    elbow