- publishing free software manuals
Perl Language Reference Manual
by Larry Wall and others
Paperback (6"x9"), 724 pages
ISBN 9781906966027
RRP £29.95 ($39.95)

Sales of this book support The Perl Foundation! Get a printed copy>>>

Possible unintended interpolation of $\ in regex

(W ambiguous) You said something like m/$\/ in a regex. The regex m/foo$\s+bar/m translates to: match the word 'foo', the output record separator (see ) and the letter 's' (one time or more) followed by the word 'bar'.

If this is what you intended then you can silence the warning by using m/${\}/ (for example: m/foo${\}s+bar/).

If instead you intended to match the word 'foo' at the end of the line followed by whitespace and the word 'bar' on the next line then you can use m/$(?)\/ (for example: m/foo$(?)\s+bar/).

ISBN 9781906966027Perl Language Reference ManualSee the print edition