Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: regular expression

by tsvika_t (Initiate)
on Jan 16, 2001 at 15:46 UTC ( #52219=note: print w/replies, xml ) Need Help??


in reply to Re: regular expression
in thread Formatting Text as HTML (was: regular expression)

Thanks for all the answers
But I should have ask it differently,
and I will put in a piece of code
in order to be more specific.
I have this code:

#!/usr/local/bin/perl

use DBI;
use strict;

my $field;
my $temp;
my $i;
my $query;
my $name;
my $value;
my $glossary_id;
my $inbuf;
my %Form;
my $pair;
read(STDIN,$inbuf,$ENV{'CONTENT_LENGTH'});
my @pairs = split(/&/,$inbuf);
foreach $pair (@pairs) {
($name,$value)=split(/=/,$pair);
$value=~tr/+/ /;
$value=~s/%(a-fA-F0-9a-fA-F0-9)/pack("C", hex($1))/eg;
$Form{$name}=$value;
}
$ENV{INFORMIXSERVER} = "develop_remote";
my $database = "test";
my $dbh = DBI->connect("dbi:Informix:$database");
if ($Form{field}=~/editor_comment/){
$query = "update glossary_develop set($Form{field}) = (\"$Form{value}\") where glossary_id=$Form{glossary_id}";
}
else {
$query = "update glossary_develop set($Form{field}) = ($Form{value}) where glossary_id=$Form{glossary_id}";
}
my $rows_affected = $dbh->do($query);

and the query is no good if it breakes in to few
line in the middle of the value: ($Form{value})

Hope I am more specific now and hope you can help me
again.
Thanks.
Tsvika.

Replies are listed 'Best First'.
Re: Re: Re: regular expression
by OeufMayo (Curate) on Jan 16, 2001 at 16:22 UTC

    BAD - BAD - BAD

    Your really should consider using CGI.pm module instead of rolling your own. This issue has been discussed over and over at perlmonks.

    Not only that it will make your scipt clearer, but it will also avoid you a lot of troubles (from Perl and from the monks) :-)

    <kbd>--
    PerlMonger::Paris(http => 'paris.pm.org');</kbd>
      OK I've been BAD!!! can you give me some examples on this CGI.pm please? I have know idea where to start and the man pages didn't help me much. Thanks, Tsvika.
      A reply falls below the community's threshold of quality. You may see it by logging in.
Re: Re: Re: regular expression
by mr_leisure (Beadle) on Jan 16, 2001 at 15:50 UTC
    Hey man - In order to make your posts more readable, use the <CODE> Code Tags</CODE>

    Check out the writeup formatting tips on the preview pages.

    You'll agree, that
    #!usr/bin/perl print "bunch of stuff"; print "and some more";
    Looks better than

    >#!usr/bin/perl print "bunch of stuff"; print "and some more";

    Cheers,
    ML
    if ($mr_leisure) { bow; }
    this is still not finished

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2021-10-18 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My first memorable Perl project was:







    Results (75 votes). Check out past polls.

    Notices?