$prices_file = "/usr/home/user/public_html/site/prices.txt"; open (OUT_FILE, ">".$prices_file) || die "ERROR: *** Cannot open output file: $prices_file. ***\n"; print OUT_FILE qq~
  • The price is \$$price
  • ~; close (OUT_FILE); my $htmlvar; open(my $fh, '<', $prices_file) or die "cannot open file $prices_file"; { local $/; $htmlvar = <$fh>; } close($fh); my $sth = $dbh->prepare(qq{UPDATE database SET htmlvar=? WHERE ID=?}); $sth->execute($htmlvar, $ID) or die $dbh->errstr; $sth->finish;