sharan has asked for the wisdom of the Perl Monks concerning the following question:
i want to store apple, cat , elephant.. in one register say as $1 and banana, dog, flag in another variable as $2. Then transfer the $1 into one column of table in Sql and $2 into another column of table. my code looks like..apple <= banana; cat := dog; elephant <= flag; and so on....
But am unable to get the desired output. Please help me... Many thanks in advance..while(<>) { if(/case .* is/) { if(/then/){ @words = split(/=/, $_); print "$_"; $sth->execute($_[0], $_[1]) or die $DBI::errstr; #even tried with @words[0] and @words[1]. }}
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: split a line into 2 variables and store in SQL
by moritz (Cardinal) on Jan 23, 2009 at 10:02 UTC | |
by sharan (Acolyte) on Jan 23, 2009 at 10:56 UTC | |
by Bloodnok (Vicar) on Jan 23, 2009 at 11:04 UTC | |
by sharan (Acolyte) on Jan 23, 2009 at 11:13 UTC | |
by Bloodnok (Vicar) on Jan 23, 2009 at 11:27 UTC | |
by moritz (Cardinal) on Jan 23, 2009 at 12:20 UTC | |
by sharan (Acolyte) on Jan 23, 2009 at 13:30 UTC | |
by moritz (Cardinal) on Jan 25, 2009 at 18:56 UTC | |
|
Re: split a line into 2 variables and store in SQL
by erix (Prior) on Jan 23, 2009 at 13:00 UTC |