Piercer has asked for the wisdom of the Perl Monks concerning the following question:
Which obviously doesn't work. What I need to do (I think) is to replace the cr/lf characters in the text with ' + Chr(13) + Chr(10) + '$a = "aaaaa\n"; $a = $a."bbbbb"; $sql="insert into test (field1) value '$a'; produces insert into test (field1) value 'aaaaa bbbbb' what it actually runs is insert into test (field1) value 'aaaaa
works correctly.$sql="insert into test (field1) value 'aaaaaaa' + Chr(13) + Chr(10) + +'bbbbbbbb';
doesn't work. As far as I can see it is interpreting + Chr(13) + Chr(10) and putting it back in as ascii value 13 and ascii value 10 rather than padding it out the way I need. Any help would be greatly appreciated.$a =~ s/chr(13)chr(10)/' + Chr(13) + Chr(10) + '/;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
(jeffa) Re: replacing carriage return line feed usinf chr()
by jeffa (Bishop) on Mar 14, 2003 at 15:10 UTC | |
|
Re: replacing carriage return line feed usinf chr()
by hv (Prior) on Mar 14, 2003 at 14:33 UTC | |
|
Re: replacing carriage return line feed usinf chr()
by DrManhattan (Chaplain) on Mar 14, 2003 at 15:20 UTC | |
|
Re: replacing carriage return line feed usinf chr()
by Piercer (Beadle) on Mar 14, 2003 at 17:45 UTC | |
by thraxil (Prior) on Mar 14, 2003 at 19:22 UTC |