in reply to Combine multiple lines into one line
Firstly, you really should avoid using $1, $2 etc for your own variables in your code as these are used by Perl for capture in regex and the use of them for other purposes can lead to weird side effects.
Removing line separators from a string is simple - you can do something like:
You probably want to see the perlre manpage if you are not certain about regular expressions.my $foo =<<EOF; line 2 line 3 line 4 EOF $foo =~ s/\r?\n/ /g; print $foo;
/J\
|
|---|