in reply to Re: Backslashes with DBI quote( ) and MySQL
in thread Backslashes with DBI quote( ) and MySQL

Just a stylistic comment, since you asked.
Personally, I don't like the visual impact of methods indented as you did, although I have to admit that it is easier to identify them. Maybe it's a matter of getting used to it.

I have three more stylistic remarks about your script, though.
  1. Your connect statement is not something a sensible administrator would recommend. Leaving the 'root' user without a password is calling for trouble. That's why I always write my examples referring to a configuration script or using a bogus password. The readers can't use your script as it is, unless they have a configuration file. So, since they have to change it anyway, I think it's better to show them the best practice.
  2. You should either set RaiseError in the connect or deal with the errors after each call to a DBI method.
  3. You should call $dbh->disconnect at the end of the script.
Cheers
_ _ _ _ (_|| | |(_|>< _|