flamewise has asked for the wisdom of the Perl Monks concerning the following question:
to clean up input lines from strange operating systems, so I tried the following:s/$CR?$LF/\n/;
This gives me:my $CR="\015"; my $LF="\012"; my $foo="unknown_os\n"; $foo =~ s{$CR?$LF}{\n}xms; print $foo;
Without the "x" this works fine.? <-- HERE follows nothing in regex; marked by <-- HERE in m/ / at -e line 4.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Variables in extended patterns?
by JavaFan (Canon) on Nov 05, 2008 at 15:52 UTC | |
by flamewise (Initiate) on Nov 05, 2008 at 16:19 UTC | |
by JavaFan (Canon) on Nov 05, 2008 at 17:56 UTC | |
by Anonymous Monk on Nov 06, 2008 at 03:17 UTC |