in reply to replacing carriage return line feed usinf chr()
The first part of a substitution is a regular expression, so you can't put arbitrary code such as chr(13) in there and expect it to do anything useful. In general, you can refer to a given character using an escape sequence such as \x (for hexadecimal):
$a =~ s/\x0d\x0a/' + Chr(13) + Chr(10) + '/;
These particular two cases are common enough to have their own names, though: ASCII chr(13) can be expressed in regular expressions as \r and chr(10) as \n:
$a =~ s/\r\n/' + Chr(13) + Chr(10) + '/;
Note also that you probably need to change all such cr/lf sequences, so you should probably be using the g option on the substition:
Hugo$a =~ s/\r\n/' + Chr(13) + Chr(10) + '/g;
|
|---|