brwarn has asked for the wisdom of the Perl Monks concerning the following question:
# initialize @row my @row; # for each table row, apply all the regex patterns in order to the tva +l_test column open(FILE, "< $file") || die "Can't open regex.txt: $!\n"; while(my $regex=<FILE>){ # get all tval_test columns my $sql_q = "select tval_test from cas_testbed.rtemp"; my $sthr = $dbh->prepare($sql_q); $sthr->execute; my @rex = split(/\s/,$regex); # work on each tval_test row while (@row = $sthr->fetchrow_array){ # search for $rex[0] and replace with $rex[1] s/$rex[0]/$rex[1]/ig; } # END while (@row = $sth->fetchrow_array) $sthr->finish; } # END while(my $regex=<FILE>) close FILE;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: DBI, s/// => unitinitialized value in substitution
by bellaire (Hermit) on Mar 05, 2009 at 17:07 UTC | |
|
Re: DBI, s/// => unitinitialized value in substitution
by kennethk (Abbot) on Mar 05, 2009 at 17:08 UTC | |
|
Re: DBI, s/// => unitinitialized value in substitution
by swampyankee (Parson) on Mar 05, 2009 at 17:08 UTC | |
by brwarn (Novice) on Mar 05, 2009 at 18:13 UTC | |
|
Re: DBI, s/// => unitinitialized value in substitution
by moritz (Cardinal) on Mar 05, 2009 at 17:07 UTC | |
|
Re: DBI, s/// => unitinitialized value in substitution
by locked_user sundialsvc4 (Abbot) on Mar 05, 2009 at 19:17 UTC |