Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Search a SQL Table and Delete Records

by ww (Archbishop)
on Aug 29, 2014 at 01:56 UTC ( [id://1098935]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Search a SQL Table and Delete Records
in thread Search a SQL Table and Delete Records

Learning Perl? Excellent!

Learning Perl by applying it when not needed and in a way that makes the specific problem more complex to solve? Not usually advised.

But for this quest: use DBI as recommended above; capture each row's id and the relevant field's contents to an array; use a regular expression to search the elements for whatever words you consider earmarks of spam (and NB roboticus' comment thereon) and when found, use the row id to tell your db engine to delete those rows.

Adopting this scheme will be a SMOP... but one that is actually fairly 'simple' and one which provides a really relevant problem case for your effort to learn Perl.


check Ln42!

  • Comment on Re^3: Search a SQL Table and Delete Records

Replies are listed 'Best First'.
Re^4: Search a SQL Table and Delete Records
by Katanya (Novice) on Aug 29, 2014 at 02:08 UTC

    Oh cool! I was wondering how I could get it to figure out which records it needed to delete. I will see if I can get this sorted out tonight. I understand the DBI part, it's just getting the searching and deleting part pieced together. Thank you both for the tips!

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1098935]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (2)
As of 2024-04-26 02:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found