sdyates has asked for the wisdom of the Perl Monks concerning the following question:
I have several scalars I want to write to the database using Update. However, I need to format the scalars so that the special characters are not an issue. Below is an example.
This works well, however, I want to perform the same function on several variables. Let's say I have three variables and I want to change them as follows:my $SD = $dbh->quote($SupportDetails); $SupportDetails = ($SD =~ s/\"/\\"/g);
I know I need a subroutine, but cannot come up with the proper one. I think I need to add some counters and lists to the routine, but I keep messing it up.original scalar -> changed scalar $SupportDetails -> $SD $Issue -> $Is $Cause -> $Ca
Any ideas or samples any of you have done
Please advise,
Simon
Edit by myocom (added code tags)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Finding a good routine
by Juerd (Abbot) on Mar 15, 2002 at 15:09 UTC | |
|
Re: Finding a good routine
by bmcatt (Friar) on Mar 15, 2002 at 15:12 UTC | |
by sdyates (Scribe) on Mar 15, 2002 at 18:22 UTC | |
|
Re: Finding a good routine
by rdfield (Priest) on Mar 15, 2002 at 15:12 UTC |