|Pathologically Eclectic Rubbish Lister|
Recommendations for breaking up string?by jdlev (Scribe)
|on Sep 16, 2015 at 18:34 UTC||Need Help??|
jdlev has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks! I'm trying to do something pretty simple, but haven't worked with Perl in a while so was looking for some recommendations.
Basically, I have a string that looks like this:
"QB Carson Palmer RB Chris Ivory RB Eddie Lacy WR A.J. Green WR John Brown WR Davante Adams TE Martellus Bennett FLEX Jeremy Hill DST Panthers"
Then I have a database with columns QB, RB1, RB2, WR1, WR2, WR3, TE, FLEX, DST.
What methods would you guys use to insert the data into a database? Would you split each string using the split function, regex it, load it into an array, or use an entirely different method and then submit everything using DBI?
I love it when a program comes together - jdhannibal