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

Hmmm.. I kind of think you have asked this question before. Most easy way to code it is something like:
#!/usr/bin/perl -p chop; $_.="<br>\n";
Hope this helps.

Jeroen
"We are not alone"(FZ)

Replies are listed 'Best First'.
Re: Re: regular expression
by tsvika_t (Initiate) on Jan 16, 2001 at 15:46 UTC
    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.

      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.
      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