in reply to Re: Variables in extended patterns?
in thread Variables in extended patterns?

Thanks.

I missed that whitespace will be discarded after variable imterpolation.

About just omitting xms: Of course that's exactly what I did, never mind what some clever guy calls "best practises".

I'm now trying to find documentation on what, exactly, \R does... My perl 5.8.6 lists a few escape-sequences in "man perlop", section "quote and quote-like characters", but not \R.

Replies are listed 'Best First'.
Re^3: Variables in extended patterns?
by JavaFan (Canon) on Nov 05, 2008 at 17:56 UTC
    I said a modern perl. 5.8.6 is four years old. It doesn't have \R. 5.10 does. See 'man perlrebackslash' (yes, you need 5.10 for that as well)
Re^3: Variables in extended patterns?
by Anonymous Monk on Nov 06, 2008 at 03:17 UTC
    You can always write
    my $CRE = '0D'; my $LFE = '0A'; s{\x{$CRE}?\x{$LFE}}{\n}xms; s{\015?\012}{\n}xms; s{\x0D\x0A}{\n}xms;
    or
    my $CRE = '\x0D'; my $LFE = '\x0A'; $_ = qq,aod \x0D\x0A another \x0D\x0A no more,; s/$CRE?$LFE/--/msxg; print; __END__ aod -- another -- no more