Martin J. Evans wrote:
This is not the correct list for this question - this list is for Perl DBI
users. Try http://lists.cpan.org/showlist.cgi?name=beginners.

Quite possibly, but the exact question rings alarm bells.

Martin
--
Martin J. Evans
Easysoft Ltd, UK
http://www.easysoft.com


On 25-Jul-2006 Amar P. Singh wrote:
Hi All,

This is my first email to the group and I hope  that I landed in the
correct place.

Ok now coming to the problem. Can someone explain to me that what this
script is doing. I want to know the meaning of all the lines in the
script.

                        $val = defined $val ? $val : "null";

                        $val =~ s/\'/$& x 2/eg; # double pad single
quote character '

This smells bad. This sounds like some poorly written code that is trying to insert values into a database, and the programmer noticed that the simple-minded approach of (e.g.)

  "insert (first, last) vakues ('$first', '$last') into t"

fails when $last eq "O'Donovan" because of quoting problems. And so they tried to dick around with doubling up quotes.

So, my suggestion to the OP is "learn about placeholders".

David
--
Much of the propaganda that passes for news in our own society is given to immobilising and pacifying people and diverting them from the idea that they can confront power. -- John Pilger

Reply via email to